dev-master
9999999-devA tool to output debugging information to shell
The Requires
console terminal shell debugging socket print_r vardump
Wallogit.com
2017 © Pedro Peláez
A tool to output debugging information to shell
Something I've found really annoying for a long time when debugging PHP code, is that print_r outputs to standard out and, in the case of web development, becomes part of your response. In simple projects this works fine. But if you're using a lot of ajax requests, that, for example, return json, using print_r becomes really annoying, because you need to dig around your browser's dev console to inspect the response, your frontend code will break because your print_r or var_dump will make your json invalid, and sometimes your printed information is not visible at all because of very mysterious reasons., (*1)
Something I really wanted, is to output debugging information to the terminal (not your browser terminal, but your Mac or Linux terminal) and keep my responses clean. And that is exactly what this tool does., (*2)
It's as simple as:, (*3)
vendor/bin/shellout shellout:listen
$_SERVER
Shell::out($_SERVER);
This is a composer package, so installation is as easy as adding the following to your require-dev:, (*4)
{
"require-dev" : {
"shellout/shellout": "@dev"
}
}
A tool to output debugging information to shell
console terminal shell debugging socket print_r vardump