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


PHP eZDebugSetting::setDebugINI方法代码示例

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


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

示例1: initialize

 function initialize()
 {
     if (ob_get_length() != 0) {
         ob_end_clean();
     }
     $debugINI = eZINI::instance('debug.ini');
     eZDebugSetting::setDebugINI($debugINI);
     // Initialize text codec settings
     $this->updateTextCodecSettings();
     // Initialize debug settings
     $this->updateDebugSettings($this->UseDebugOutput);
     // Set the different permissions/settings.
     $ini = eZINI::instance();
     $iniFilePermission = $ini->variable('FileSettings', 'StorageFilePermissions');
     $iniDirPermission = $ini->variable('FileSettings', 'StorageDirPermissions');
     $iniVarDirectory = eZSys::cacheDirectory();
     eZCodePage::setPermissionSetting(array('file_permission' => octdec($iniFilePermission), 'dir_permission' => octdec($iniDirPermission), 'var_directory' => $iniVarDirectory));
     eZExecution::addCleanupHandler('eZDBCleanup');
     eZExecution::addFatalErrorHandler('eZFatalError');
     eZDebug::setHandleType(eZDebug::HANDLE_FROM_PHP);
     if ($this->UseExtensions) {
         // Check for extension
         eZExtension::activateExtensions('default');
         // Extension check end
     } else {
         if (!$this->isQuiet()) {
             $cli = eZCLI::instance();
             $cli->output("Notice: This script uses 'use-extensions' => false, meaning extension settings are not loaded!");
         }
     }
     $siteaccess = $this->SiteAccess;
     if ($siteaccess) {
         $access = array('name' => $siteaccess, 'type' => eZSiteAccess::TYPE_STATIC);
     } else {
         $ini = eZINI::instance();
         $siteaccess = $ini->variable('SiteSettings', 'DefaultAccess');
         $access = array('name' => $siteaccess, 'type' => eZSiteAccess::TYPE_DEFAULT);
     }
     $access = eZSiteAccess::change($access);
     if ($this->UseExtensions) {
         // Check for siteaccess extension
         eZExtension::activateExtensions('access');
         // Extension check end
     }
     // Now that all extensions are activated and siteaccess has been changed, reset
     // all eZINI instances as they may not take into account siteaccess specific settings.
     eZINI::resetAllInstances(false);
     // Set the global setting which is read by the session lib
     $GLOBALS['eZSiteBasics']['session-required'] = $this->UseSession;
     if ($this->UseSession) {
         $db = eZDB::instance();
         if ($db->isConnected()) {
             eZSession::start();
         } else {
             $this->setIsInitialized(false);
             $this->InitializationErrorMessage = 'database error: ' . $db->errorMessage();
             return;
         }
     }
     if ($this->User) {
         $userLogin = $this->User['login'];
         $userPassword = $this->User['password'];
         if ($userLogin and $userPassword) {
             $userID = eZUser::loginUser($userLogin, $userPassword);
             if (!$userID) {
                 $cli = eZCLI::instance();
                 if ($this->isLoud()) {
                     $cli->warning('Failed to login with user ' . $userLogin);
                 }
                 eZExecution::cleanup();
                 eZExecution::setCleanExit();
             }
         }
     }
     // Initialize module handling
     if ($this->UseModules) {
         $moduleRepositories = eZModule::activeModuleRepositories($this->UseExtensions);
         eZModule::setGlobalPathList($moduleRepositories);
     }
     $this->setIsInitialized(true);
 }
开发者ID:nlescure,项目名称:ezpublish,代码行数:81,代码来源:ezscript.php

示例2: error_reporting

$siteBasics['module-run-required'] =& $moduleRunRequired;
$siteBasics['policy-check-required'] =& $policyCheckRequired;
$siteBasics['policy-check-omit-list'] =& $policyCheckOmitList;
$siteBasics['url-translator-allowed'] =& $urlTranslatorAllowed;
$siteBasics['validity-check-required'] =& $validityCheckRequired;
$siteBasics['user-object-required'] =& $userObjectRequired;
$siteBasics['session-required'] =& $sessionRequired;
$siteBasics['db-required'] =& $dbRequired;
$siteBasics['no-cache-adviced'] =& $noCacheAdviced;
$siteBasics['site-design-override'] =& $siteDesignOverride;
$siteBasics['module-repositories'] =& $moduleRepositories;
$GLOBALS['eZSiteBasics'] =& $siteBasics;
$GLOBALS['eZRedirection'] = false;
error_reporting(E_ALL | E_STRICT);
$debugINI = eZINI::instance('debug.ini');
eZDebugSetting::setDebugINI($debugINI);
/*!
 Reads settings from site.ini and passes them to eZDebug.
*/
function eZUpdateDebugSettings()
{
    $ini = eZINI::instance();
    $settings = array();
    list($settings['debug-enabled'], $settings['debug-by-ip'], $settings['log-only'], $settings['debug-by-user'], $settings['debug-ip-list'], $logList, $settings['debug-user-list']) = $ini->variableMulti('DebugSettings', array('DebugOutput', 'DebugByIP', 'DebugLogOnly', 'DebugByUser', 'DebugIPList', 'AlwaysLog', 'DebugUserIDList'), array('enabled', 'enabled', 'disabled', 'enabled'));
    $logMap = array('notice' => eZDebug::LEVEL_NOTICE, 'warning' => eZDebug::LEVEL_WARNING, 'error' => eZDebug::LEVEL_ERROR, 'debug' => eZDebug::LEVEL_DEBUG, 'strict' => eZDebug::LEVEL_STRICT);
    $settings['always-log'] = array();
    foreach ($logMap as $name => $level) {
        $settings['always-log'][$level] = in_array($name, $logList);
    }
    eZDebug::updateSettings($settings);
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:index.php


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