コード例 #1
0
ファイル: class.symphony.php プロジェクト: bauhouse/sym-forum
 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);
 }
コード例 #2
0
 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'));
 }
コード例 #3
0
 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'));
 }
コード例 #4
0
@ini_set("gd.jpeg_ignore_warning", 1);
@ini_set('magic_quotes_runtime', false);
// Set appropriate error reporting:
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
define('DOCROOT', rtrim(realpath(dirname(__FILE__) . '/../../../'), '/'));
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '/') . str_replace('/extensions/jit_image_manipulation/lib', null, dirname($_SERVER['PHP_SELF'])), '/'));
// Include some parts of the engine
require_once DOCROOT . '/vendor/autoload.php';
require_once 'class.image.php';
require_once CONFIG;
Symphony::initialiseConfiguration($settings);
// Setup the environment
if (method_exists('DateTimeObj', 'setSettings')) {
    DateTimeObj::setSettings($settings['region']);
} else {
    DateTimeObj::setDefaultTimezone($settings['region']['timezone']);
}
define_safe('MODE_NONE', 0);
define_safe('MODE_RESIZE', 1);
define_safe('MODE_RESIZE_CROP', 2);
define_safe('MODE_CROP', 3);
define_safe('MODE_FIT', 4);
define_safe('CACHING', $settings['image']['cache'] == 1 ? true : false);
set_error_handler('__errorHandler');
function processParams($string, &$image_settings)
{
    $param = (object) array('mode' => 0, 'width' => 0, 'height' => 0, 'position' => 0, 'background' => 0, 'file' => 0, 'external' => false);
    // Check for matching recipes
    if (file_exists(WORKSPACE . '/jit-image-manipulation/recipes.php')) {
        include WORKSPACE . '/jit-image-manipulation/recipes.php';
    }
コード例 #5
0
 /**
  * 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'));
 }
コード例 #6
0
ファイル: extension.driver.php プロジェクト: ErisDS/Bugaroo
 private function __updateSystemTimezoneOffset()
 {
     $offset = Symphony::Database()->fetchVar('value', 0, "SELECT `value` \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `tbl_entries_data_" . self::memberTimezoneOffsetFieldID() . "` \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `entry_id` = '" . Symphony::Database()->cleanValue($this->Member->get('id')) . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1");
     if (strlen(trim($offset)) == 0) {
         return;
     }
     //When using 'Etc/GMT...' the +/- signs are reversed. E.G. GMT+10 == Etc/GMT-10
     DateTimeObj::setDefaultTimezone('Etc/GMT' . ($offset >= 0 ? '-' : '+') . abs($offset));
 }
コード例 #7
0
 protected function __construct()
 {
     self::$Configuration = new Configuration();
     DateTimeObj::setDefaultTimezone(self::Configuration()->core()->region->timezone);
     self::$_lang = self::Configuration()->core()->symphony->lang ? self::Configuration()->core()->symphony->lang : 'en';
     define_safe('__SYM_DATE_FORMAT__', self::Configuration()->core()->region->{'date-format'});
     define_safe('__SYM_TIME_FORMAT__', self::Configuration()->core()->region->{'time-format'});
     define_safe('__SYM_DATETIME_FORMAT__', sprintf('%s %s', __SYM_DATE_FORMAT__, __SYM_TIME_FORMAT__));
     define_safe('ADMIN_URL', sprintf('%s/%s', URL, trim(self::Configuration()->core()->symphony->{'administration-path'}, '/')));
     $this->initialiseLog();
     GenericExceptionHandler::initialise();
     GenericErrorHandler::initialise(self::$Log);
     $this->initialiseCookie();
     $this->initialiseDatabase();
     Extension::init();
     Cache::setDriver(self::Configuration()->core()->{'cache-driver'});
     Lang::loadAll(true);
 }
コード例 #8
0
 /**
  * This function will adjust the locale for the currently logged in
  * user if the active Member section has a Member: Timezone field.
  *
  * @param integer $member_id
  * @return void
  */
 public function updateSystemTimezoneOffset()
 {
     if (is_null($this->Member)) {
         return;
     }
     $timezone = $this->section->getField('timezone');
     if (!$timezone instanceof fieldMemberTimezone) {
         return;
     }
     $tz = $timezone->getMemberTimezone($this->getMemberID());
     if (is_null($tz)) {
         return;
     }
     try {
         DateTimeObj::setDefaultTimezone($tz);
     } catch (Exception $ex) {
         Symphony::Log()->pushToLog(__('Members Timezone') . ': ' . $ex->getMessage(), $ex->getCode(), true);
     }
 }
コード例 #9
0
ファイル: extension.driver.php プロジェクト: brendo/members
 /**
  * This function will adjust the locale for the currently logged in
  * user if the active Member section has a Member: Timezone field.
  *
  * @param integer $member_id
  * @return void
  */
 public function updateSystemTimezoneOffset($member_id)
 {
     $timezone = extension_Members::getField('timezone');
     if (!$timezone instanceof fieldMemberTimezone) {
         return;
     }
     $tz = $timezone->getMemberTimezone($member_id);
     if (is_null($tz)) {
         return;
     }
     try {
         DateTimeObj::setDefaultTimezone($tz);
     } catch (Exception $ex) {
         Symphony::$Log->pushToLog(__('Members Timezone') . ': ' . $ex->getMessage(), $code, true);
     }
 }