/** * Override the default Symphony constructor to initialise the Log, Config * and Database objects for installation/update. This allows us to use the * normal accessors. */ protected function __construct() { if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } // Include the default Config for installation. include INSTALL . '/includes/config_default.php'; $this->initialiseConfiguration($settings); // Initialize date/time 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')); // Initialize language $this->initialiseLang(); // Initialize logs $this->initialiseLog(INSTALL_LOGS . '/install'); // Initialize database $this->initialiseDatabase(); // Initialize error handlers GenericExceptionHandler::initialise(Symphony::Log()); GenericErrorHandler::initialise(Symphony::Log()); }
/** * 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() { self::$Profiler = Profiler::instance(); if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } // 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')); self::initialiseErrorHandler(); // Initialize language management Lang::initialize(); Lang::set(self::$Configuration->get('lang', 'symphony')); self::initialiseCookie(); // If the user is not a logged in Author, turn off the verbose error messages. if (!self::isLoggedIn() && is_null(self::$Author)) { GenericExceptionHandler::$enabled = false; } // Engine is ready. self::$Profiler->sample('Engine Initialisation'); }
protected function __construct() { $this->Profiler = new Profiler(); if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } include CONFIG; self::$Configuration = new Configuration(true); self::$Configuration->setArray($settings); define_safe('__LANG__', self::$Configuration->get('lang', 'symphony') ? self::$Configuration->get('lang', 'symphony') : 'en'); 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__ . ' ' . __SYM_TIME_FORMAT__); $this->initialiseLog(); GenericExceptionHandler::initialise(); GenericErrorHandler::initialise($this->Log); $this->initialiseCookie(); try { Lang::init(LANG . '/lang.%s.php', __LANG__); } catch (Exception $e) { trigger_error($e->getMessage(), E_USER_ERROR); } $this->initialiseDatabase(); if (!$this->initialiseExtensionManager()) { throw new SymphonyErrorPage('Error creating Symphony extension manager.'); } DateTimeObj::setDefaultTimezone(self::$Configuration->get('timezone', 'region')); }
protected function __construct() { $this->Profiler = new Profiler(); if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } include CONFIG; self::$Configuration = new Configuration(true); self::$Configuration->setArray($settings); DateTimeObj::setDefaultTimezone(self::$Configuration->get('timezone', 'region')); self::$_lang = self::$Configuration->get('lang', 'symphony') ? self::$Configuration->get('lang', 'symphony') : 'en'; // Legacy support for __LANG__ constant define_safe('__LANG__', self::lang()); 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__ . ' ' . __SYM_TIME_FORMAT__); $this->initialiseLog(); GenericExceptionHandler::initialise(); GenericErrorHandler::initialise(self::$Log); $this->initialiseCookie(); $this->initialiseDatabase(); if (!$this->initialiseExtensionManager()) { throw new SymphonyErrorPage('Error creating Symphony extension manager.'); } Lang::loadAll($this->ExtensionManager); }
/** * The Symphony constructor initialises the class variables of Symphony. At present * constructor has a couple of responsibilities: * - Start a profiler instance * - If magic quotes are enabled, clean `$_SERVER`, `$_COOKIE`, `$_GET` and `$_POST` arrays * - Initialise the correct Language for the currently logged in Author. * - Start the session and adjust the error handling if the user is logged in */ protected function __construct() { self::$Profiler = Profiler::instance(); if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } // Initialize language management Lang::initialize(); Lang::set(self::$Configuration->get('lang', 'symphony')); self::initialiseCookie(); // If the user is not a logged in Author, turn off the verbose error messages. if (!self::isLoggedIn() && is_null(self::$Author)) { GenericExceptionHandler::$enabled = false; } // Engine is ready. self::$Profiler->sample('Engine Initialisation'); }
protected function __construct() { $this->Profiler = new Profiler(); if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } include CONFIG; $this->Configuration = new Configuration(true); $this->Configuration->setArray($settings); $cookie_path = parse_url(URL, PHP_URL_PATH); $cookie_path = '/' . trim($cookie_path, '/'); define_safe('__SYM_COOKIE_PATH__', $cookie_path); define_safe('__SYM_COOKIE_PREFIX_', $this->Configuration->get('cookie_prefix', 'symphony')); define_safe('__LANG__', $this->Configuration->get('lang', 'symphony') ? $this->Configuration->get('lang', 'symphony') : 'en'); define_safe('__SYM_DATE_FORMAT__', $this->Configuration->get('date_format', 'region')); define_safe('__SYM_TIME_FORMAT__', $this->Configuration->get('time_format', 'region')); define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . ' ' . __SYM_TIME_FORMAT__); $this->initialiseLog(); error_reporting(E_ALL); set_error_handler(array(&$this, '__errorHandler')); $this->Cookie =& new Cookie(__SYM_COOKIE_PREFIX_, TWO_WEEKS, __SYM_COOKIE_PATH__); try { Lang::init(LANG . '/lang.%s.php', __LANG__); } catch (Exception $e) { trigger_error($e->getMessage(), E_USER_ERROR); } if (!$this->initialiseDatabase()) { $error = $this->Database->getLastError(); $this->customError(E_USER_ERROR, 'Symphony Database Error', $error['num'] . ': ' . $error['msg'], true, true, 'database-error', array('error' => $error, 'message' => __('There was a problem whilst attempting to establish a database connection. Please check all connection information is correct. The following error was returned.'))); } if (!$this->initialiseExtensionManager()) { trigger_error('Error creating Symphony extension manager.', E_USER_ERROR); } DateTimeObj::setDefaultTimezone($this->Configuration->get('timezone', 'region')); }
/** * 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')); }
* * Symphony web publishing system * * Copyright 2004–2006 Twenty One Degrees Pty. Ltd. * * @version 1.7 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE * ***/ error_reporting(E_ALL ^ E_NOTICE); set_magic_quotes_runtime(0); header('Expires: Mon, 12 Dec 1982 06:14:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-cache, must-revalidate, max-age=0'); header('Pragma: no-cache'); require_once DOCROOT . "/symphony/lib/boot/defines.php"; require_once LIBRARY . "/func.librarian.php"; ##Decide the boot mode. Minimal WILL NOT instanciate the entire engine. if (!defined("__SYMPHONY_MINIMAL_BOOT__") || !__SYMPHONY_MINIMAL_BOOT__) { ##Load all the core library files Librarian(LIBRARY . "/boot", array("config.php", "defines.php", "bundle.php")); Librarian(LIBRARY . "/core", null, array("class.manager.php", "class.template.php", "class.log.php", "class.cacheable.php")); //Start the Log process. $symLog = new SymphonyLog(array_merge($settings, array("log_path" => LOGS . "/" . date("Ymd", time() - (date("Z") - date("I") * 3600)) . ".log"))); if (get_magic_quotes_gpc()) { General::cleanArray($_SERVER); General::cleanArray($_COOKIE); General::cleanArray($_GET); General::cleanArray($_POST); } }
function cleanArray(&$arr) { foreach ($arr as $k => $v) { if (is_array($v)) { General::cleanArray($arr[$k]); } else { $arr[$k] = stripslashes($v); } } }