lib/ezutils/classes/ezdebugsetting.php
File containing the eZDebugSetting class
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- lib
- Version
- 4.6.0
\eZDebugSetting
Provides conditional debug output
This works as a wrapper for the eZDebug class by checking some conditions defined in site.ini before writing the message. The condition must be true for the message to be written.
It will check the debug.ini file and first see if conditions are enabled globally by reading DebugSettings/ConditionDebug. If true if will then see if the condition exists in the GeneralCondition group, if so it will use it for condition check. If it doesn't exists generally it will check it specifically according to the message type for instance ErrorCondition, DebugCondition etc.
Example of debug.ini:
[DebugSettings]
ConditionDebug=enabled
[GeneralCondition]
my-flag=enabled
other-flag=disabled
[ErrorCondition]
bad-name-flag=disabled
Methods


addTimingPoint(
string $conditionName, string $label
=
""
)
:
void
Adds the timing point if the condition $conditionName is enabled.
Name | Type | Description |
---|---|---|
$conditionName | string | Name of the condition |
$label | string | Optional label |


changeLabel(
string $conditionName, string $label
=
''
)
:
string
Creates a new debug label from the original and the condition and returns it.
Name | Type | Description |
---|---|---|
$conditionName | string | Name of the condition |
$label | string | Optional label |
Type | Description |
---|---|
string | $label . '<' . $conditionName . '>' |


isConditionTrue(
string $conditionName, $messageType
)
:
bool
Returns true if the condition $conditionName is considered enabled.
Name | Type | Description |
---|---|---|
$conditionName | string | Name of the condition |
$messageType |
Type | Description |
---|---|
bool |


setDebugINI(
\eZINI $ini
)
:
void
Sets the INI object
Name | Type | Description |
---|---|---|
$ini | \eZINI | The eZINI object to set. |
- Deprecated
- Since 4.5


writeDebug(
string $conditionName, string $string, string $label
=
""
)
:
void
Writes a debug message if the condition $conditionName is enabled.
Name | Type | Description |
---|---|---|
$conditionName | string | Name of the condition |
$string | string | Text to write |
$label | string | Optional label |


writeError(
string $conditionName, string $string, string $label
=
""
)
:
void
Writes a debug error if the condition $conditionName is enabled.
Name | Type | Description |
---|---|---|
$conditionName | string | Name of the condition |
$string | string | Text to write |
$label | string | Optional label |


writeNotice(
string $conditionName, string $string, string $label
=
""
)
:
void
Writes a debug notice if the condition $conditionName is enabled.
Name | Type | Description |
---|---|---|
$conditionName | string | Name of the condition |
$string | string | Text to write |
$label | string | Optional label |