System Modes

From Cloudrexx Development Wiki
Jump to: navigation, search

Introduction

Cloudrexx is run in purpose-optimized modes. Each initialization of Cloudrexx (HTTP(S) Request, CLI command, RESTful-API-call and JsonData-calls) is executed/processed in one of the defined system modes. Each mode is optimized for a specific purpose and does therefore only execute a subset of the whole system components. The selection of the system mode is done automatically based on how the initialization has been triggered.

Modes

Mode Description Automatic invocation on... Identifier Bootstrapping
Frontend By default, Cloudrexx is run in Frontend mode. This mode is used to process regular HTTP(S)-requests made to the website (from web browsers).
  • All HTTP(S)-requests (except those to /cadmin and /api)
\Cx\Core\Core\Controller\Cx::MODE_FRONTEND
Backend The management interface (a.k.a Backend) is run in Backend system mode. \Cx\Core\Core\Controller\Cx::MODE_BACKEND
Command Commands are executed in Command system mode. \Cx\Core\Core\Controller\Cx::MODE_COMMAND
Minimal Can be used to access the Cloudrexx framework in a standalone PHP-script. - \Cx\Core\Core\Controller\Cx::MODE_MINIMAL

Manual Invocation

In a standalone PHP-script, the invocation of each mode can be forced as follows:

/* set $mode to one of:
 * \Cx\Core\Core\Controller\Cx::MODE_FRONTEND
 * \Cx\Core\Core\Controller\Cx::MODE_BACKEND
 * \Cx\Core\Core\Controller\Cx::MODE_COMMAND
 * \Cx\Core\Core\Controller\Cx::MODE_MINIMAL
 */
require_once '/<path to Cloudrexx installation>/core/Core/init.php';
$cx = init($mode);