Architecture
From Lanius CMS Wiki
Contents |
Architecture
Root files
Lanius CMS is built to be small, functional and capable of running on any database engine (also Gladius DB).
The core of Lanius CMS contains only some classes, include files and core plugins which build a small framework on top of which everything else can be built and run.
There are mainly 2 scripts which allow access to the whole system.
- index.php - main output renderer which renders the website with relative active component
- admin.php - main administrative interface output renderer
The root directory contains as well other important files:
- version.php - file holding the Lanius CMS version and an auxiliary version information retrieval mechanism (disabled by default)
- core.php - the core inclusion file which sets up a valid Lanius CMS framework
- docs.php - documentation references proxy which redirects to the requested documentation pages
- 404.php - a dummy file that can be used as redirection target for 404 not found HTTP errors
- index2.php - alternative output renderer which is used to render printable content without any template
- admin2.php - alternative admin interface output renderer without template (depreciated)
Main rendering explained
The index.php script rendering process goes through the following steps in order to provide a valid Lanius CMS response:
- include core.php to prepare the Lanius CMS framework; core.php will:
- record the page start time (into the $page_start_time global variable)
- include version.php
- if the config.php file does not exist in the private folder, redirect to install/index.php (to proceed with installation)
- include config.php from the private folder ($d_private)
- setup the custom error handler
- include src/includes/dracon.php which contains input validation functions
- include src/includes/adodb.php which will setup a working database connection through adoDB lite
- include src/includes/functions.php which contains various global functions necessary to Lanius CMS execution
- include src/includes/header.php to prepare the HTTP response serving
- setup $time (which is basically time() + a custom amount of hours (offset) specified in $d_offset
- start the session (an eventual custom session handler can be actived from here too)
- include and start the User class (recognizes already logged-in users and other preferences)
- include the localized common.php
- include src/includes/user_functions.php which contains functions needed for the user impersonation
- include and start the Pathway class
- include and start the DrabotHandler class
- include and start the CMS class - the main web response class
- if statistics are always enabled ($d_stats), hit them
- include the localized user.php
- serve the correct Content-Type and Content-Language headers
- setup UTF-8 support (will use emulated UTF-8 support if none available through PHP)
- check if the website is online; if it is not, show the offline message and exit
- initializes the only allowed globals which are $option, $Itemid and $catid (these are going to be removed too)
- buffer the main component output through ob_start()
- send the necessary HTTP headers
- render the template, which will output the buffered component output in the correct place (through CMS::DumpComponent())

