1 | <?php |
||
12 | class Debug { |
||
13 | |||
14 | /** |
||
15 | * @var integer $DEBUG enable (1) or disable (0) debugging |
||
16 | */ |
||
17 | private $DEBUG; |
||
18 | |||
19 | /** |
||
20 | * @var array $debugInfo Data array with debugging information |
||
21 | */ |
||
22 | private $arrDebugInfo; |
||
23 | |||
24 | /** |
||
25 | * @var float $startTime Start time of our debugger |
||
26 | */ |
||
27 | private $floatStartTime; |
||
28 | |||
29 | /** |
||
30 | * Construct our class |
||
31 | * @param integer $DEBUG [optional] Enable (>=1) or disable (0) debugging |
||
32 | * @return none |
||
|
|||
33 | */ |
||
34 | function __construct($log, $DEBUG=0) { |
||
42 | |||
43 | /** |
||
44 | * If we want to set our debugging level in a child class this allows us to do so |
||
45 | * @param integer $DEBUG our debugging level |
||
46 | */ |
||
47 | function setDebug($DEBUG) { |
||
50 | |||
51 | /** |
||
52 | * Return a backtrace strin |
||
53 | * @return string Full backtrace <file>:<line> but no refereces to debug class |
||
54 | */ |
||
55 | public function getBacktrace() { |
||
67 | |||
68 | /** |
||
69 | * We fill our data array here |
||
70 | * @param string $msg Debug Message |
||
71 | * @param string $file [optional] File name |
||
72 | * @param integer $line [optional] Line inside the $file |
||
73 | * @param integer $debug [optional] Debugging level, default 1 |
||
74 | * @param string $class [optional] Class this is called from |
||
75 | * @param string $method [optional] Method this is called from |
||
76 | * @return none |
||
77 | */ |
||
78 | function append($msg, $debug=1) { |
||
89 | |||
90 | /** |
||
91 | * Return the created strDebugInfo array |
||
92 | * @return none |
||
93 | */ |
||
94 | public function getDebugInfo() { |
||
97 | |||
98 | /** |
||
99 | * Directly print the debugging information, table formatted |
||
100 | * @return none |
||
101 | */ |
||
102 | function printDebugInfo() { |
||
109 | |||
110 | } |
||
111 | |||
114 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.