Example #1
0
function eZUpdateDebugSettings()
{
    $ini = eZINI::instance();

    list( $debugSettings['debug-enabled'], $debugSettings['debug-by-ip'], $debugSettings['debug-by-user'], $debugSettings['debug-ip-list'], $debugSettings['debug-user-list'] ) =
        $ini->variableMulti( 'DebugSettings', array( 'DebugOutput', 'DebugByIP', 'DebugByUser', 'DebugIPList', 'DebugUserIDList' ), array ( 'enabled', 'enabled', 'enabled' ) );
    eZDebug::updateSettings( $debugSettings );
}
Example #2
0
function eZUpdateDebugSettings()
{
    $ini = eZINI::instance();
    $debugSettings = array();
    $debugSettings['debug-enabled'] = $ini->variable('DebugSettings', 'DebugOutput') == 'enabled';
    $debugSettings['debug-by-ip'] = $ini->variable('DebugSettings', 'DebugByIP') == 'enabled';
    $debugSettings['debug-ip-list'] = $ini->variable('DebugSettings', 'DebugIPList');
    eZDebug::updateSettings($debugSettings);
}
/**
 * Reads settings from site.ini and passes them to eZDebug
 *
 * @deprecated Since 5.0
 */
function eZUpdateDebugSettings()
{
    $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']) = eZINI::instance()->variableMulti('DebugSettings', array('DebugOutput', 'DebugByIP', 'DebugLogOnly', 'DebugByUser', 'DebugIPList', 'AlwaysLog', 'DebugUserIDList'), array('enabled', 'enabled', 'disabled', 'enabled'));
    $settings['always-log'] = array();
    foreach (array('notice' => eZDebug::LEVEL_NOTICE, 'warning' => eZDebug::LEVEL_WARNING, 'error' => eZDebug::LEVEL_ERROR, 'debug' => eZDebug::LEVEL_DEBUG, 'strict' => eZDebug::LEVEL_STRICT) as $name => $level) {
        $settings['always-log'][$level] = $logList !== null && in_array($name, $logList);
    }
    eZDebug::updateSettings($settings);
}
 function eZUpdateDebugSettings()
 {
     $ini = eZINI::instance();
     $debugSettings = array('debug-enabled' => false);
     $logList = $ini->variable('DebugSettings', 'AlwaysLog');
     $logMap = array('notice' => eZDebug::LEVEL_NOTICE, 'warning' => eZDebug::LEVEL_WARNING, 'error' => eZDebug::LEVEL_ERROR, 'debug' => eZDebug::LEVEL_DEBUG, 'strict' => eZDebug::LEVEL_STRICT);
     $debugSettings['always-log'] = array();
     foreach ($logMap as $name => $level) {
         $debugSettings['always-log'][$level] = in_array($name, $logList);
     }
     eZDebug::updateSettings($debugSettings);
 }
<?php

/**
 * @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2013.5
 * @package kernel
 */
eZExpiryHandler::registerShutdownFunction();
if (!defined('MAX_AGE')) {
    define('MAX_AGE', 86400);
}
// Ensure to deactivate pagelayout and debug output in case we're going through index_tree_menu.php
$Result['pagelayout'] = false;
eZDebug::updateSettings(array('debug-enabled' => false));
// We use aggressive browser caching by default, by manually set appropriate HTTP headers.
// This behavior can be deactivated by setting 'use-cache-headers' user parameter to false.
$useCacheHeaders = isset($UserParameters['use-cache-headers']) ? (bool) $UserParameters['use-cache-headers'] : true;
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $useCacheHeaders) {
    header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + MAX_AGE) . ' GMT');
    header('Cache-Control: max-age=' . MAX_AGE);
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) . ' GMT');
    header('Pragma: ');
    $Result['content'] = '';
    return;
}
$nodeID = (int) $Params['NodeID'];
$siteINI = eZINI::instance();
$contentstructuremenuINI = eZINI::instance('contentstructuremenu.ini');
if ($contentstructuremenuINI->variable('TreeMenu', 'Dynamic') != 'enabled') {
Example #6
0
 function updateDebugSettings($useDebug = null)
 {
     global $debugOutput;
     global $useLogFiles;
     $ini = eZINI::instance();
     $cli = eZCLI::instance();
     $debugSettings = array();
     $debugSettings['debug-enabled'] = ($ini->variable('DebugSettings', 'DebugOutput') == 'enabled' and $ini->variable('DebugSettings', 'ScriptDebugOutput') == 'enabled');
     if ($useDebug !== null) {
         $debugSettings['debug-enabled'] = $useDebug;
     }
     $debugSettings['debug-by-ip'] = $ini->variable('DebugSettings', 'DebugByIP') == 'enabled';
     $debugSettings['debug-ip-list'] = $ini->variable('DebugSettings', 'DebugIPList');
     if (isset($debugOutput)) {
         $debugSettings['debug-enabled'] = $debugOutput;
     }
     $debugSettings['debug-log-files-enabled'] = $useLogFiles;
     if ($cli->useStyles() and !$cli->isWebOutput()) {
         $debugSettings['debug-styles'] = $cli->terminalStyles();
     }
     $logList = $ini->variable('DebugSettings', 'AlwaysLog');
     $logMap = array('notice' => eZDebug::LEVEL_NOTICE, 'warning' => eZDebug::LEVEL_WARNING, 'error' => eZDebug::LEVEL_ERROR, 'debug' => eZDebug::LEVEL_DEBUG, 'strict' => eZDebug::LEVEL_STRICT);
     $debugSettings['always-log'] = array();
     foreach ($logMap as $name => $level) {
         $debugSettings['always-log'][$level] = in_array($name, $logList);
     }
     eZDebug::updateSettings($debugSettings);
 }
Example #7
0
 /**
  * Initializes/updates debug settings, system wide
  */
 public function updateDebugSettings()
 {
     $ini = eZINI::instance();
     $debugSettings = array();
     $debugSettings['debug-enabled'] = ($ini->variable('DebugSettings', 'DebugOutput') == 'enabled' and $this->restINI->variable('DebugSettings', 'Debug') == 'enabled');
     $debugSettings['debug-by-ip'] = $ini->variable('DebugSettings', 'DebugByIP') == 'enabled';
     $debugSettings['debug-ip-list'] = $ini->variable('DebugSettings', 'DebugIPList');
     $logList = $ini->variable('DebugSettings', 'AlwaysLog');
     $logMap = array('notice' => eZDebug::LEVEL_NOTICE, 'warning' => eZDebug::LEVEL_WARNING, 'error' => eZDebug::LEVEL_ERROR, 'debug' => eZDebug::LEVEL_DEBUG, 'strict' => eZDebug::LEVEL_STRICT);
     $debugSettings['always-log'] = array();
     foreach ($logMap as $name => $level) {
         $debugSettings['always-log'][$level] = in_array($name, $logList);
     }
     eZDebug::updateSettings($debugSettings);
 }