How vmakar2160/osticket works
Purpose and runtime
osTicket is a server-rendered PHP support-ticket system: web, email, and phone-originated requests become tickets for staff handling. It targets Apache or IIS, PHP 7.2–7.4, and MySQL via mysqli; IMAP, SMTP/sendmail, GD, gettext, JSON, mbstring, and XML extend core capabilities. Bootstrap and shared initialization begin at bootstrap.php, main.inc.php, and include/class.osticket.php.
HTTP entry surfaces
The public client portal is rooted in index.php, with ticket creation and viewing through open.php, tickets.php, and view.php; reusable client rendering lives under include/client/. The staff control panel is independently routed through scp/index.php, scp/tickets.php, and scp/staff.inc.php, rendering views from include/staff/. AJAX is a separate controller boundary at ajax.php and scp/ajax.php, backed by feature-specific handlers such as include/ajax.tickets.php.
Domain and persistence core
Ticket handling centers on include/class.ticket.php, include/class.thread.php, and include/class.message.php: tickets contain conversation threads/messages, notes, assignments, status, SLA, and task relationships. Users, staff, departments, teams, organizations, roles, and authentication are modeled in include/class.user.php, include/class.staff.php, and include/class.dept.php. Database access and object persistence use the internal model/ORM layer in include/class.model.php, include/class.orm.php, and include/mysqli.php; MySQL schema installation starts at setup/inc/streams/core/install-mysql.sql.
Intake, routing, and notifications
Web forms feed dynamic-form validation and ticket creation through include/class.dynamic_forms.php, include/class.forms.php, and include/class.ticket.php. Email ingestion is handled by parsing/fetching components (include/class.mailfetch.php, include/class.mailparse.php) and API/pipe endpoints (api/pipe.php, api/http.php). Filters, help topics, queues, departments, and SLAs determine routing and priority via include/class.filter.php, include/class.topic.php, and include/class.sla.php. Ticket events generate outbound notifications through include/class.mailer.php and include/class.email.php, using localized templates in include/i18n/en_US/templates/email/.
APIs, jobs, and automation
The external HTTP API is exposed under api/index.php, authenticated/processed through api/api.inc.php and include/class.api.php; ticket-specific operations are in include/api.tickets.php. Scheduled processing is entered by api/cron.php or staff-side scp/autocron.php, with execution logic in include/class.cron.php and include/api.cron.php. The CLI dispatcher manage.php exposes operational modules in include/cli/modules/, including deployment, upgrades, imports/exports, file migration, and cron execution.
Security and extensibility boundaries
Session and identity boundaries are implemented by include/class.ostsession.php, include/class.usersession.php, include/class.auth.php, with CSRF, 2FA, passwords, and cryptography in include/class.csrf.php, include/class.2fa.php, and include/class.crypto.php. File attachments are managed behind include/class.attachment.php and include/class.file.php. Plugins are loaded through include/class.plugin.php from include/plugins/, allowing extensions without coupling them directly into ticket workflows.
Lifecycle, upgrades, and localization
Initial installation is a dedicated setup application at setup/index.php and setup/install.php, driven by setup/inc/class.installer.php. Runtime upgrades are initiated from the staff panel (scp/upgrade.php) and executed through include/class.upgrader.php; versioned SQL/PHP migration streams reside in include/upgrader/streams/core/. Translation catalogs, system defaults, and email/page templates are YAML-based under include/i18n/en_US/, interpreted through include/class.i18n.php and include/class.yaml.php.
Main entry points: class.ticket.php Ticket domain · class.ostsession.php Sessions & security · index.php Client portal · scp/index.php Staff panel
Components 21
Entry Surfaces
- Client portal
index.php - Staff panel
scp/index.php - AJAX controllers
ajax.php - External API
api/index.php
Ticket Core
- Ticket domain · Tickets own threads, messages, assignments, status, SLAs, and tasks.
include/class.ticket.php - Threads & messages
include/class.thread.php - Users & organization
include/class.user.php - Sessions & security
include/class.ostsession.php - Routing policy
include/class.filter.php - Dynamic forms
include/class.dynamic_forms.php - Model / ORM
include/class.model.php - MySQL
setup/inc/streams/core/install-mysql.sql
Intake & Automation
- Email intake
include/class.mailfetch.php - Mail API & pipe
api/pipe.php - Email notifications
include/class.mailer.php - Localized templates
- Scheduled jobs
include/class.cron.php - Plugin extensions · Extensions load without direct coupling to ticket workflows.
include/class.plugin.php
Lifecycle
- Installer
setup/index.php - Upgrade engine
include/class.upgrader.php - Management CLI
manage.php
Connections 26
- Client portal → Sessions & security: client session
- Client portal → Dynamic forms: submits requests
- Client portal → Ticket domain: creates and views
- Staff panel → Sessions & security: staff session
- Staff panel → Ticket domain: handles tickets
- Staff panel → Upgrade engine: initiates
- AJAX controllers → Ticket domain: ticket actions
- External API → Sessions & security: authenticates
- External API → Ticket domain: ticket operations
- Dynamic forms → Ticket domain: validated creation
- Mail API & pipe → Email intake: receives mail
- Email intake → Ticket domain: creates or replies
- Ticket domain → Threads & messages: contains
- Ticket domain → Routing policy: applies routing
- Ticket domain → Email notifications: emits events
- Email notifications → Localized templates: renders
- Ticket domain → Model / ORM: persists
- Users & organization → Model / ORM: persists
- Sessions & security → Users & organization: resolves identity
- Model / ORM → MySQL: mysqli access
- Scheduled jobs → Ticket domain: scheduled processing
- Plugin extensions → Ticket domain: extends
- Installer → MySQL: installs schema
- Upgrade engine → MySQL: runs migrations
- Management CLI → Scheduled jobs: runs
- Management CLI → Upgrade engine: operates