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


PHP SimpleSAML_Utilities::initTimezone方法代码示例

本文整理汇总了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();
 }
开发者ID:emma5021,项目名称:toba,代码行数:18,代码来源:LoggingHandlerFile.php

示例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();
开发者ID:williamamed,项目名称:Raptor2,代码行数:30,代码来源:_include.php


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