本文整理汇总了PHP中SimpleSAML_Utilities::initTimezone方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Utilities::initTimezone方法的具体用法?PHP SimpleSAML_Utilities::initTimezone怎么用?PHP SimpleSAML_Utilities::initTimezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_Utilities
的用法示例。
在下文中一共展示了SimpleSAML_Utilities::initTimezone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$config = SimpleSAML_Configuration::getInstance();
assert($config instanceof SimpleSAML_Configuration);
/* Get the metadata handler option from the configuration. */
$this->logFile = $config->getPathValue('loggingdir', 'log/') . $config->getString('logging.logfile', 'simplesamlphp.log');
$this->processname = $config->getString('logging.processname', 'simpleSAMLphp');
if (@file_exists($this->logFile)) {
if (!@is_writeable($this->logFile)) {
throw new Exception("Could not write to logfile: " . $this->logFile);
}
} else {
if (!@touch($this->logFile)) {
throw new Exception("Could not create logfile: " . $this->logFile . " Loggingdir is not writeable for the webserver user.");
}
}
SimpleSAML_Utilities::initTimezone();
}
示例2: set_error_handler
set_error_handler('SimpleSAML_error_handler');
/**
* Class which should print a warning every time a reference to $SIMPLESAML_INCPREFIX is made.
*/
class SimpleSAML_IncPrefixWarn
{
/**
* Print a warning, as a call to this function means that $SIMPLESAML_INCPREFIX is referenced.
*
* @return A blank string.
*/
function __toString()
{
$backtrace = debug_backtrace();
$where = $backtrace[0]['file'] . ':' . $backtrace[0]['line'];
error_log('Deprecated $SIMPLESAML_INCPREFIX still in use at ' . $where . '. The simpleSAMLphp library now uses an autoloader.');
return '';
}
}
/* Set the $SIMPLESAML_INCPREFIX to a reference to the class. */
$SIMPLESAML_INCPREFIX = new SimpleSAML_IncPrefixWarn();
$configdir = dirname(dirname(__FILE__)) . '/config';
if (!file_exists($configdir . '/config.php')) {
header('Content-Type: text/plain');
echo "You have not yet created the simpleSAMLphp configuration files.\n";
echo "See: https://simplesamlphp.org/docs/devel/simplesamlphp-install-repo\n";
exit(1);
}
/* Set the timezone. */
SimpleSAML_Utilities::initTimezone();