当前位置: 首页>>代码示例>>PHP>>正文


PHP DateTimeObj::setDefaultTimezone方法代码示例

本文整理汇总了PHP中DateTimeObj::setDefaultTimezone方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeObj::setDefaultTimezone方法的具体用法?PHP DateTimeObj::setDefaultTimezone怎么用?PHP DateTimeObj::setDefaultTimezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DateTimeObj的用法示例。


在下文中一共展示了DateTimeObj::setDefaultTimezone方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 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);
 }
开发者ID:bauhouse,项目名称:sym-forum,代码行数:29,代码来源:class.symphony.php

示例2: __construct

 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'));
 }
开发者ID:aaronsalmon,项目名称:symphony-2,代码行数:31,代码来源:class.symphony.php

示例3: __construct

 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'));
 }
开发者ID:bauhouse,项目名称:sym-spectrum,代码行数:38,代码来源:class.symphony.php

示例4: error_reporting

@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';
    }
开发者ID:symphonycms,项目名称:jit_image_manipulation,代码行数:31,代码来源:image.php

示例5: __construct

 /**
  * 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'));
 }
开发者ID:scottkf,项目名称:keepflippin--on-symphony,代码行数:43,代码来源:class.symphony.php

示例6: __updateSystemTimezoneOffset

 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));
 }
开发者ID:ErisDS,项目名称:Bugaroo,代码行数:9,代码来源:extension.driver.php

示例7: __construct

 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);
 }
开发者ID:pointybeard,项目名称:symphony-3,代码行数:18,代码来源:class.symphony.php

示例8: updateSystemTimezoneOffset

 /**
  * 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);
     }
 }
开发者ID:andrewminton,项目名称:members,代码行数:26,代码来源:class.members.php

示例9: updateSystemTimezoneOffset

 /**
  * 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);
     }
 }
开发者ID:brendo,项目名称:members,代码行数:23,代码来源:extension.driver.php


注:本文中的DateTimeObj::setDefaultTimezone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。