| @@ 204-234 (lines=31) @@ | ||
| 201 | } |
|
| 202 | } |
|
| 203 | ||
| 204 | if (!function_exists('j')) { |
|
| 205 | /** |
|
| 206 | * Alias of Kint::dump(), however the output is dumped to the javascript console and |
|
| 207 | * added to the global array `kintDump`. If run in CLI mode, output is pure whitespace. |
|
| 208 | * |
|
| 209 | * To force rendering mode without autodetecting anything: |
|
| 210 | * |
|
| 211 | * Kint::enabled( Kint::MODE_JS ); |
|
| 212 | * Kint::dump( $variable ); |
|
| 213 | * |
|
| 214 | * @return string |
|
| 215 | */ |
|
| 216 | function j() |
|
| 217 | { |
|
| 218 | if (!Kint::enabled()) { |
|
| 219 | return ''; |
|
| 220 | } |
|
| 221 | ||
| 222 | $stash = Kint::settings(); |
|
| 223 | ||
| 224 | Kint::enabled( |
|
| 225 | PHP_SAPI === 'cli' && Kint::$cliDetection === true ? Kint::MODE_CLI : Kint::MODE_JS |
|
| 226 | ); |
|
| 227 | ||
| 228 | $out = call_user_func_array(array('kint\Kint', 'dump'), func_get_args()); |
|
| 229 | ||
| 230 | Kint::settings($stash); |
|
| 231 | ||
| 232 | return $out; |
|
| 233 | } |
|
| 234 | } |
|
| 235 | ||
| 236 | if (!function_exists('jd')) { |
|
| 237 | /** |
|
| @@ 260-287 (lines=28) @@ | ||
| 257 | } |
|
| 258 | } |
|
| 259 | ||
| 260 | if (!function_exists('je')) { |
|
| 261 | /** |
|
| 262 | * @see j() |
|
| 263 | * @see de() |
|
| 264 | * |
|
| 265 | * @return string |
|
| 266 | */ |
|
| 267 | function je() |
|
| 268 | { |
|
| 269 | if (!Kint::enabled()) { |
|
| 270 | return ''; |
|
| 271 | } |
|
| 272 | ||
| 273 | $stash = Kint::settings(); |
|
| 274 | ||
| 275 | Kint::$delayedMode = true; |
|
| 276 | ||
| 277 | Kint::enabled( |
|
| 278 | PHP_SAPI === 'cli' && Kint::$cliDetection === true ? Kint::MODE_CLI : Kint::MODE_JS |
|
| 279 | ); |
|
| 280 | ||
| 281 | $out = call_user_func_array(array('kint\Kint', 'dump'), func_get_args()); |
|
| 282 | ||
| 283 | Kint::settings($stash); |
|
| 284 | ||
| 285 | return $out; |
|
| 286 | } |
|
| 287 | } |
|
| 288 | } |
|
| 289 | } |
|
| 290 | ||