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