1 | <?php |
||
10 | class KintBootup |
||
11 | { |
||
12 | /** |
||
13 | * init |
||
14 | */ |
||
15 | public static function init() |
||
37 | |||
38 | public static function initFunctions() |
||
39 | { |
||
40 | /** |
||
41 | * quick-debug: print the variable $var [exit] [echo || return] |
||
42 | * |
||
43 | * @param mixed $var |
||
44 | * @param boolean $exit exit after debug-output? (only via "echo") |
||
45 | * @param boolean $echo true => use "echo", otherwise use "return" |
||
46 | * @param boolean $plaintext use a simple "print_r()" instead of kind? |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | function dump($var, $exit = true, $echo = true, $plaintext = false) |
||
80 | |||
81 | /** |
||
82 | * Alias of Kint::dump() |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | function d() |
||
90 | |||
91 | |||
92 | /** |
||
93 | * Alias of Kint::dump() |
||
94 | * [!!!] IMPORTANT: execution will halt after call to this function |
||
95 | * |
||
96 | * @return string |
||
97 | * @deprecated |
||
98 | */ |
||
99 | function dd() |
||
109 | |||
110 | /** |
||
111 | * Alias of Kint::dump() |
||
112 | * [!!!] IMPORTANT: execution will halt after call to this function |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | function ddd() |
||
125 | |||
126 | /** |
||
127 | * Alias of Kint::dump(), however the output is delayed until the end of the script |
||
128 | * |
||
129 | * @see d(); |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | function de() |
||
142 | |||
143 | /** |
||
144 | * Alias of Kint::dump(), however the output is in plain html-escaped text and some minor visibility enhancements |
||
145 | * added. If run in CLI mode, output is pure whitespace. |
||
146 | * |
||
147 | * To force rendering mode without auto-detecting anything: |
||
148 | * |
||
149 | * Kint::enabled( Kint::MODE_PLAIN ); |
||
150 | * Kint::dump( $variable ); |
||
151 | * |
||
152 | * [!!!] IMPORTANT: execution will halt after call to this function |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | function s() |
||
177 | |||
178 | /** |
||
179 | * @see s() |
||
180 | * |
||
181 | * [!!!] IMPORTANT: execution will halt after call to this function |
||
182 | * |
||
183 | * @return string |
||
184 | */ |
||
185 | function sd() |
||
201 | |||
202 | /** |
||
203 | * @see s() |
||
204 | * @see de() |
||
205 | * |
||
206 | * @return string |
||
207 | */ |
||
208 | function se() |
||
231 | |||
232 | /** |
||
233 | * Alias of Kint::dump(), however the output is dumped to the javascript console and |
||
234 | * added to the global array `kintDump`. If run in CLI mode, output is pure whitespace. |
||
235 | * |
||
236 | * To force rendering mode without autodetecting anything: |
||
237 | * |
||
238 | * Kint::enabled( Kint::MODE_JS ); |
||
239 | * Kint::dump( $variable ); |
||
240 | * |
||
241 | * @return string |
||
242 | */ |
||
243 | function j() |
||
261 | |||
262 | /** |
||
263 | * @see j() |
||
264 | * |
||
265 | * [!!!] IMPORTANT: execution will halt after call to this function |
||
266 | * |
||
267 | * @return string |
||
268 | */ |
||
269 | function jd() |
||
283 | |||
284 | /** |
||
285 | * @see j() |
||
286 | * @see de() |
||
287 | * |
||
288 | * @return string |
||
289 | */ |
||
290 | function je() |
||
311 | |||
312 | } |
||
313 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: