shellout/shellout

There is no license information available for the latest version (dev-master) of this package.

A tool to output debugging information to shell

dev-master 2013-11-03 13:15 UTC

This package is not auto-updated.

Last update: 2024-03-25 22:56:33 UTC


README

print_r and ajax : nope

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.

Keep the response clean

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.

It's as simple as:

  1. start the "server" (which is nothig more than a listening socket that outputs what it receives). This is where your debug information will show.
vendor/bin/shellout shellout:listen
  1. In your code, output for example $_SERVER
Shell::out($_SERVER);
  1. And you'll get this in your terminal:

image

Installation

This is a composer package, so installation is as easy as adding the following to your require-dev:

{
  "require-dev" : {
    "shellout/shellout": "@dev"
  }
}