Architecture

Root files

Drake CMS is built to be small, functional and capable of running on any database engine (also Gladius DB).

The core of Drake 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 files though which the whole of the system is accessed

The root folder contains as well other important files:

Main rendering explained

The index.php file rendering process goes through the following steps in order to provide a valid Drake CMS response:

  1. include core.php to prepare the Drake CMS framework; core.php will:
    1. record the page start time (into the $page_start_time global variable)
    2. include version.php
    3. if the config.php file does not exist in the private folder, redirect to install/index.php (to proceed with installation)
    4. include config.php from the private folder ($d_private)
    5. setup the custom error handler
    6. include includes/dracon.php which contains input validation functions
    7. include includes/adodb.php which will setup a working database connection through adoDB lite
    8. include includes/functions.php which contains various global functions necessary to Drake CMS execution
  2. include includes/header.php to prepare the HTTP response serving
    1. setup $time (which is basically time() + a custom amount of hours (offset) specified in $d_offset
    2. start the session (an eventual custom session handler can be actived from here too)
    3. include and start the User class (recognizes already logged-in users and other preferences)
    4. include the localized common.php
    5. include includes/user_functions.php which contains functions needed for the user impersonation
    6. include and start the Pathway class
    7. include and start the DrabotHandler class
    8. include and start the Drake class - the main web response class
    9. if statistics are always enabled ($d_stats), hit them
    10. include the localized user.php
    11. serve the correct Content-Type and Content-Language headers
    12. setup UTF-8 support (will use emulated UTF-8 support if none available through PHP)
    13. check if the website is online; if it is not, show the offline message and exit
    14. initializes the only allowed globals which are $option, $Itemid and $catid (these are going to be removed too)
  3. buffer the main component output through ob_start()
  4. send the necessary HTTP headers
  5. render the template, which will output the buffered component output in the correct place (through Drake::DumpComponent())

Directory structure

See Directory structure for further details on each directory's role.