Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezdebugsetting.php
Go to the documentation of this file.
1 <?php
38 class eZDebugSetting
39 {
47 static function isConditionTrue( $conditionName, $messageType )
48 {
49 $ini = eZINI::instance( 'debug.ini' );
50
51 if ( $ini->variable( 'DebugSettings', 'ConditionDebug' ) != 'enabled' )
52 return false;
53
54 $generalSetting = 'GeneralCondition';
55 if ( $ini->hasVariable( $generalSetting, $conditionName ) )
56 return $ini->variable( $generalSetting, $conditionName ) == 'enabled';
57
58 $specificSetting = eZDebug::instance()->messageName( $messageType ) . 'Condition';
59 if ( $ini->hasVariable( $specificSetting, $conditionName ) )
60 return $ini->variable( $specificSetting, $conditionName ) == 'enabled';
61 }
62
70 static function changeLabel( $conditionName, $label = '' )
71 {
72 if ( $label == '' )
73 return '<' . $conditionName . '>';
74 else
75 return $label . ' <' . $conditionName . '>';
76 }
77
85 static function writeNotice( $conditionName, $string, $label = "" )
86 {
87 if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_NOTICE ) )
88 return false;
89 eZDebug::writeNotice( $string, eZDebugSetting::changeLabel( $conditionName, $label ) );
90 }
91
99 static function writeWarning( $conditionName, $string, $label = "" )
100 {
101 if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_WARNING ) )
102 return false;
103 eZDebug::writeWarning( $string, eZDebugSetting::changeLabel( $conditionName, $label ) );
104 }
105
113 static function writeError( $conditionName, $string, $label = "" )
114 {
115 if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_ERROR ) )
116 return false;
117 eZDebug::writeError( $string, eZDebugSetting::changeLabel( $conditionName, $label ) );
118 }
119
127 static function writeDebug( $conditionName, $string, $label = "" )
128 {
129 if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_DEBUG ) )
130 return false;
131 eZDebug::writeDebug( $string, eZDebugSetting::changeLabel( $conditionName, $label ) );
132 }
133
140 static function addTimingPoint( $conditionName, $label = "" )
141 {
142 if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_TIMING_POINT ) )
143 return false;
144 eZDebug::addTimingPoint( eZDebugSetting::changeLabel( $conditionName, $label ) );
145 }
146 }
147
148 ?>
eZDebugSetting
Definition: ezdebugsetting.php:39
eZDebugSetting\isConditionTrue
static isConditionTrue( $conditionName, $messageType)
Definition: ezdebugsetting.php:47
eZDebugSetting\changeLabel
static changeLabel( $conditionName, $label='')
Definition: ezdebugsetting.php:70
eZDebugSetting\writeError
static writeError( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:113
eZDebugSetting\writeDebug
static writeDebug( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:127
eZDebugSetting\writeWarning
static writeWarning( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:99
eZDebugSetting\addTimingPoint
static addTimingPoint( $conditionName, $label="")
Definition: ezdebugsetting.php:140
eZDebugSetting\writeNotice
static writeNotice( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:85
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\LEVEL_ERROR
const LEVEL_ERROR
Definition: ezdebug.php:61
eZDebug\writeDebug
static writeDebug( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:588
eZDebug\writeNotice
static writeNotice( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:459
eZDebug\instance
static instance()
Definition: ezdebug.php:201
eZDebug\LEVEL_WARNING
const LEVEL_WARNING
Definition: ezdebug.php:60
eZDebug\writeWarning
static writeWarning( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:502
eZDebug\LEVEL_TIMING_POINT
const LEVEL_TIMING_POINT
Definition: ezdebug.php:62
eZDebug\addTimingPoint
static addTimingPoint( $description="")
Definition: ezdebug.php:676
eZDebug\LEVEL_NOTICE
const LEVEL_NOTICE
Definition: ezdebug.php:59
eZDebug\LEVEL_DEBUG
const LEVEL_DEBUG
Definition: ezdebug.php:63
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.