1: <?php
2:
3: /**
4: * This file contains the hidden debug class.
5: *
6: * @package Core
7: * @subpackage Debug
8: * @version SVN Revision $Rev:$
9: *
10: * @author Rudi Bieller
11: * @copyright four for business AG <www.4fb.de>
12: * @license http://www.contenido.org/license/LIZENZ.txt
13: * @link http://www.4fb.de
14: * @link http://www.contenido.org
15: */
16:
17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
18:
19: /**
20: * Debug object to show info hidden in HTML comment-blocks.
21: *
22: * @package Core
23: * @subpackage Debug
24: */
25: class cDebugHidden implements cDebugInterface {
26:
27: /**
28: * Singleton instance
29: *
30: * @var cDebugHidden
31: */
32: private static $_instance;
33:
34: /**
35: * Return singleton instance.
36: *
37: * @return cDebugHidden
38: */
39: static public function getInstance() {
40: if (self::$_instance == NULL) {
41: self::$_instance = new cDebugHidden();
42: }
43: return self::$_instance;
44: }
45:
46: /**
47: * Constructor
48: */
49: private function __construct() {
50: }
51:
52: /**
53: * Writes a line.
54: *
55: * @see cDebugInterface::out()
56: * @param string $msg
57: */
58: public function out($msg) {
59: echo ("\n <!-- dbg\n");
60: echo ($msg);
61: echo ("\n-->");
62: }
63:
64: /**
65: * Outputs contents of passed variable in a preformatted, readable way
66: *
67: * @param mixed $mVariable
68: * The variable to be displayed
69: * @param string $sVariableDescription [optional]
70: * The variable's name or description
71: * @param bool $bExit [optional]
72: * If set to true, your app will die() after output of current var
73: */
74: public function show($mVariable, $sVariableDescription = '', $bExit = false) {
75: echo "\n <!-- dbg";
76: if ($sVariableDescription != '') {
77: echo ' ' . strval($sVariableDescription);
78: }
79: echo " -->\n";
80: echo '<!--' . "\n";
81: if (is_array($mVariable)) {
82: print_r($mVariable);
83: } else {
84: var_dump($mVariable);
85: }
86: echo "\n" . '//-->' . "\n";
87: echo "\n <!-- /dbg -->\n";
88:
89: if ($bExit === true) {
90: die();
91: }
92: }
93:
94: /**
95: * Interface implementation
96: *
97: * @param mixed $mVariable
98: * @param string $sVariableDescription [optional]
99: */
100: public function add($mVariable, $sVariableDescription = '') {
101: }
102:
103: /**
104: * Interface implementation
105: */
106: public function reset() {
107: }
108:
109: /**
110: * Interface implementation
111: */
112: public function showAll() {
113: }
114: }
115: