/**
  * The Symphony constructor initialises the class variables of Symphony.
  * It will set the DateTime settings, define new date constants and initialise
  * the correct Language for the currently logged in Author. If magic quotes
  * are enabled, Symphony will sanitize the `$_SERVER`, `$_COOKIE`,
  * `$_GET` and `$_POST` arrays. The constructor loads in
  * the initial Configuration values from the `CONFIG` file
  */
 protected function __construct()
 {
     $this->Profiler = Profiler::instance();
     $this->Profiler->sample('Engine Initialisation');
     if (get_magic_quotes_gpc()) {
         General::cleanArray($_SERVER);
         General::cleanArray($_COOKIE);
         General::cleanArray($_GET);
         General::cleanArray($_POST);
     }
     // Includes the existing CONFIG file and initialises the Configuration
     // by setting the values with the setArray function.
     include CONFIG;
     self::$Configuration = new Configuration(true);
     self::$Configuration->setArray($settings);
     DateTimeObj::setDefaultTimezone(self::$Configuration->get('timezone', 'region'));
     define_safe('__SYM_DATE_FORMAT__', self::$Configuration->get('date_format', 'region'));
     define_safe('__SYM_TIME_FORMAT__', self::$Configuration->get('time_format', 'region'));
     define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . self::$Configuration->get('datetime_separator', 'region') . __SYM_TIME_FORMAT__);
     // Initialize language management
     Lang::initialize();
     $this->initialiseLog();
     GenericExceptionHandler::initialise(self::$Log);
     GenericErrorHandler::initialise(self::$Log, self::$Configuration->get('strict_error_handling', 'symphony'));
     $this->initialiseDatabase();
     $this->initialiseExtensionManager();
     $this->initialiseCookie();
     // If the user is not a logged in Author, turn off the verbose error
     // messages.
     if (!self::isLoggedIn() && is_null($this->Author)) {
         GenericExceptionHandler::$enabled = false;
     }
     // Set system language
     Lang::set(self::$Configuration->get('lang', 'symphony'));
 }
Example #2
0
 /**
  * Setter for `$Configuration`. This function initialise the configuration
  * object and populate its properties based on the given $array.
  *
  * @since Symphony 2.3
  * @param array $data
  *  An array of settings to be stored into the Configuration object
  */
 public function initialiseConfiguration(array $data = array())
 {
     if (empty($data)) {
         // Includes the existing CONFIG file and initialises the Configuration
         // by setting the values with the setArray function.
         include CONFIG;
         $data = $settings;
     }
     self::$Configuration = new Configuration(true);
     self::$Configuration->setArray($data);
 }
Example #3
0
 /**
  * Setter for `$Configuration`. This function initialise the configuration
  * object and populate its properties based on the given `$array`. Since
  * Symphony 2.6.5, it will also set Symphony's date constants.
  *
  * @since Symphony 2.3
  * @param array $data
  *  An array of settings to be stored into the Configuration object
  */
 public static function initialiseConfiguration(array $data = array())
 {
     if (empty($data)) {
         // Includes the existing CONFIG file and initialises the Configuration
         // by setting the values with the setArray function.
         include CONFIG;
         $data = $settings;
     }
     self::$Configuration = new Configuration(true);
     self::$Configuration->setArray($data);
     // Set date format throughout the system
     define_safe('__SYM_DATE_FORMAT__', self::Configuration()->get('date_format', 'region'));
     define_safe('__SYM_TIME_FORMAT__', self::Configuration()->get('time_format', 'region'));
     define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . self::Configuration()->get('datetime_separator', 'region') . __SYM_TIME_FORMAT__);
     DateTimeObj::setSettings(self::Configuration()->get('region'));
 }