menu_book Navigation menu

General Configuration (Bootstrap & Globals)

In Pragma CMS, initialization is extremely fast. Instead of relying on slow, runtime .env parsers, the system boots through a strict sequence of native PHP includes (index.phpbootstrap.phpconfig.php).

During this phase, the CMS defines critical System Constants and loads the Global Site Settings directly from the database into the $site object.

1. System Constants (Paths & URLs)

These constants are defined immediately upon request in public/index.php and bootstrap.php. They provide absolute, unchangeable paths to the server structure, ensuring optimal file inclusion performance.

ConstantDescription
ROOT_DIRThe absolute physical path to the server root.
PUBLIC_DIRThe public-facing web directory (/public).
CMS_VERSIONS_DIRThe directory holding all core engine versions.
CMS_CORE_DIRThe absolute path to the currently active core engine version.
SITES_DIRThe multi-tenant directory holding all individual sites.
SITE_HANDLEThe unique identifier of the currently requested site (resolved via Domain Mapping).
SITE_DIRThe absolute path to the active site's configuration and assets (SITES_DIR / SITE_HANDLE).
LICENSE_KEYThe global commercial license key loaded from license.php.

2. Dynamic Environment Constants

Once the specific site is identified, config.php defines URL and security constants based on the active domain and database settings.

ConstantDescription
SITE_NAMEThe official name of the site (fetched from DB).
SITE_URLThe canonical URL of the site (used for SEO, canonicals, and emails).
BASE_URLThe current request's base URL (e.g., http://localhost or https://domain.com).
CMS_DISALLOW_FILE_EDITSet to true to disable the in-browser Monaco file editor (Recommended for production).

3. Global Database Settings ($site->settings)

Unlike immutable physical paths, functional configurations are managed by the administrator in the Back-office and loaded into the $site->settings array.

Setting KeyDefaultDescription
debug_mode0If 1, enables display_errors and sets error_reporting(E_ALL).
maintenance_mode0If 1, forces a 503 Maintenance screen for all non-admin visitors.
active_theme'default-theme'The active theme folder used by the TemplateEngine.
hide_default_language_in_url1If true, strips the language code from the URL for the default language.

4. CMS Identity & Version Metadata

These constants define the identity, versioning, and external references of the Pragma CMS core. They are loaded from version.php and remain immutable during runtime.

ConstantDescription
CMS_NAMEThe official product name of the CMS.
CMS_VERSIONThe current installed core version (semantic versioning).
CMS_RELEASE_DATEThe release date of the current CMS version.
CMS_WEBSITE_URLOfficial website of Pragma CMS. Used for documentation and branding references.
CMS_API_URLBase URL of the official Pragma CMS API (used for updates, marketplace, and services).