Download the PHP package ivoba/stop without Composer
On this page you can find all versions of the php package ivoba/stop. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package stop
Stop
Stop is a lightweight Dumper for PHP 5.3+ , thus a replacement for
During developing pretty often i found myself typing: or
So this lib provides:
- shortcut functions
- some more infos as File, Line & Memory
- some nicer rendering with Twitter Bootstrap,
- options for return or continue & hide which will print to javascript console
- disable Stop for prod env
- autoloading
- extensibility, if youd like to use jqueryUI f.e just subclass the Dumper and set the class
- context awareness: if you are in console it will render in text mode, if in ajax mode it will render in json mode
- dumper for json strings
- stop_type as a better version of
Its pretty lightweight since it basically just uses PHP functions plus some sugar. If you need more power have a look at: https://github.com/raulfraile/ladybug or http://raveren.github.io/kint/
Install
via composer, put this in your require block:
"ivoba/stop": "dev-master"
then
composer update ivoba/stop
Using Stop
Functions:
By default, resp. via composer install, Stop will include global functions to ease access to the debug methods
this is probably the fastest way with or without IDE Autocompletion.
If you also have functions named stop or stop_dump in your project: rename them, dude! No mercy! or use the class ;)
this will output print_r($var) in a code block and will exit the script:
or the shortcut
this will output var_dump($var) in a code block and will exit the script:
or the shortcut
Options
There are 3 options that can be passed as parameters:
- $continue: if this is true the script will not exit, default is false
- $hide: if this is true it will print to javascript console, default is false
- $return: if this is true the script will return the output, default is false
Shortcut functions for options:
- Stop and Go! (resp. print_r)
- Stop and Go and Hide! (resp. print_r)
- Stop Dump and Go! (resp. var_dump)
- Stop Dump and Go and Hide! (resp. var_dump)
- Stop Dump as Json! (decodes a json string and send it inside the dump object as json to the browser. Use browser addons like JSONovich for pretty rendering.)
- StopType! (resp. get_type | get_class & class_uses & class_implements & class_parents)
- StopType and Go! (resp. get_type | get_class & class_uses & class_implements & class_parents)
Static Class Methods:
OO Style:
Requirements
PHP > 5.3 nothing more
I recommend however to install XDebug for nicer var_dump rendering.