1 | <?php |
||
23 | class AdminPageFramework_Debug extends AdminPageFramework_Debug_Base { |
||
24 | |||
25 | /** |
||
26 | * Prints out the given variable contents |
||
27 | * |
||
28 | * If a file pass is given to the second parameter, it saves the output in the file. |
||
29 | * |
||
30 | * @since 3.2.0 |
||
31 | * @remark An alias of the dumpArray() method. |
||
32 | * @param array|string $asArray The variable to check its contents. |
||
33 | * @param string $sFilePath The file path for a log file. |
||
34 | * @return void |
||
35 | */ |
||
36 | static public function dump( $asArray, $sFilePath=null ) { |
||
39 | |||
40 | /** |
||
41 | * Returns a string representation of a given value with details. |
||
42 | * @since 3.8.9 |
||
43 | * @return string |
||
44 | */ |
||
45 | static public function getDetails( $mValue, $bEscape=true ) { |
||
55 | |||
56 | /** |
||
57 | * Retrieves the output of the given variable contents. |
||
58 | * |
||
59 | * If a file pass is given to the second parameter, it saves the output in the file. |
||
60 | * |
||
61 | * @remark An alias of getArray() method. |
||
62 | * @since 3.2.0 |
||
63 | * @param array|string $asArray The variable to check its contents. |
||
64 | * @param string $sFilePath The file path for a log file. |
||
65 | * @param boolean $bEscape Whether to escape characters. |
||
66 | */ |
||
67 | static public function get( $asArray, $sFilePath=null, $bEscape=true ) { |
||
80 | |||
81 | /** |
||
82 | * Logs the given variable output to a file. |
||
83 | * |
||
84 | * <h4>Example</h4> |
||
85 | * <code> |
||
86 | * $_aValues = array( 'foo', 'bar' ); |
||
87 | * AdminPageFramework_Debug::log( $aValues ); |
||
88 | * </code> |
||
89 | * |
||
90 | * @remark The alias of the `logArray()` method. |
||
91 | * @since 3.1.0 |
||
92 | * @since 3.1.3 Made it leave milliseconds and elapsed time from the last call of the method. |
||
93 | * @since 3.3.0 Made it indicate the data type. |
||
94 | * @since 3.3.1 Made it indicate the data length. |
||
95 | * @param mixed $mValue The value to log. |
||
96 | * @param string $sFilePath The log file path. |
||
97 | * @return void |
||
98 | **/ |
||
99 | static public function log( $mValue, $sFilePath=null ) { |
||
131 | /** |
||
132 | * Determines the log file path. |
||
133 | * @since 3.5.3 |
||
134 | * @internal |
||
135 | * @return string The path of the file to log the contents. |
||
136 | */ |
||
137 | static private function _getLogFilePath( $bsFilePath, $sCallerClass ) { |
||
150 | /** |
||
151 | * Creates a file. |
||
152 | * @return boolean |
||
153 | * @internal |
||
154 | */ |
||
155 | static private function _createFile( $sFilePath ) { |
||
166 | |||
167 | /** |
||
168 | * Returns the heading part of a log item. |
||
169 | * @since 3.5.3 |
||
170 | * @internal |
||
171 | * @return string the heading part of a log item. |
||
172 | */ |
||
173 | static private function _getLogHeadingLine( $fCurrentTimeStamp, $nElapsed, $sCallerClass, $sCallerFunction ) { |
||
199 | /** |
||
200 | * Returns formatted elapsed time. |
||
201 | * @since 3.5.3 |
||
202 | * @internal |
||
203 | * @return string Formatted elapsed time. |
||
204 | */ |
||
205 | static private function _getFormattedElapsedTime( $nElapsed ) { |
||
228 | |||
229 | } |
||
230 |