Last change
on this file since 3743 was
3743,
checked in by Criss, 15 years ago
|
Put under SVN control
Add obsolete list
Add language configuration for items texts
Add template variable
|
File size:
810 bytes
|
Line | |
---|
1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | class CF_Debug { |
---|
5 | static $debug=array(); |
---|
6 | |
---|
7 | static function show_debug() { |
---|
8 | if (!defined('CF_DEBUG_ACTIVE') or !CF_DEBUG_ACTIVE) { |
---|
9 | return; |
---|
10 | } |
---|
11 | echo '<pre>'; |
---|
12 | foreach(CF_Debug::$debug as $label => $values) { |
---|
13 | echo '{== BEGIN ' . $label . ' ==}<br>'; |
---|
14 | foreach($values as $debug_value) { |
---|
15 | echo $debug_value . '<br>'; |
---|
16 | } |
---|
17 | echo '{== END ' . $label . ' ==}<br>'; |
---|
18 | } |
---|
19 | echo '</pre><br>'; |
---|
20 | } |
---|
21 | static function add_debug($variable, $label=null) { |
---|
22 | $value = print_r($variable, true); |
---|
23 | if (null == $label) { |
---|
24 | $label = 'CF_Debug'; |
---|
25 | } |
---|
26 | if (!isset(CF_Debug::$debug[$label])) { |
---|
27 | CF_Debug::$debug[$label] = array(); |
---|
28 | } |
---|
29 | array_push(CF_Debug::$debug[$label], $value); |
---|
30 | } |
---|
31 | |
---|
32 | } |
---|
33 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.