Environment Variables & Deployment
Pragma CMS avoids the overhead of parsing .env files on every HTTP request. Environment contexts are managed through highly optimized native PHP mechanisms.
Development vs. Production (DEV_MODE)
The CMS automatically detects its environment at the earliest stage of the boot sequence (public/index.php).
If the request originates from a local IP (127.0.0.1 or ::1), the DEV_MODE constant is automatically set to true.
In Production, DEV_MODE is false.
What does DEV_MODE do?
When active, the CMS triggers automatic Asset Synchronization. CSS, JS, and vendor files from the locked cms-core directory are automatically published and overwritten into the /public/assets/ directory on every request, ensuring developers always see the latest core updates without manual cache clearing.
Logging Environment
Pragma CMS separates system errors from application logic errors to keep debugging straightforward. Logs are stored securely outside of the public root.
- PHP Error Log:
sites/{site_handle}/storage/logs/php-error.log(Catches fatal errors, parse errors, and strict warnings). - Application Log:
sites/{site_handle}/storage/logs/application.log(Catches business logic errors via thelogError()helper, such as failed API calls or missing configurations).
Zero-Downtime Maintenance Flag
The maintenance mode in Pragma CMS can be triggered in two ways:
- Automatically via system settings: when
maintenance_modeis enabled in the site configuration, the CMS enters maintenance state globally. - Automatically during CMS updates or critical operations: the system may temporarily enable maintenance mode to ensure safe upgrades.
- Manually via deployment flag: for deployments or emergency maintenance, you can place a physical file named
maintenance.flagat the root of a site directory (sites/{site_handle}/maintenance.flag).
The router detects both the configuration state and the presence of this file at bootstrap level and immediately halts execution, returning a 503 Service Unavailable HTTP status.
Note: Logged-in administrators bypass maintenance mode, allowing safe verification before reopening the site to the public.