Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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