Download the PHP package mathiasgrimm/x without Composer
On this page you can find all versions of the php package mathiasgrimm/x. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mathiasgrimm/x
More information about mathiasgrimm/x
Files in mathiasgrimm/x
Package x
Short Description Quick debug for web and cli environment
License
Homepage https://github.com/mathiasgrimm/x/
Informations about the package x
X
-
X is a collection of php functions to quickly debug php while working with web or cli (command line interface)
-
X is a replacement for the common php print_r/var_dump debug approach
- X provides a convenient way to debug in live environment
Usage
Output
will print:
DEBUG X File: /Users/mathiasgrimm/Google Drive/projects/github/x/test/XTest.php Line: 15 ARG [0] 1 ARG [1] 2 ARG [2] 3 ARG [3] Array ( [0] => PHP [1] => Java [2] => JavaScript )
Live Environment Debug
In general, live environments are hard to debug, however X makes it less terrible.
Lets say you want to debug the Login page of your website while not displaying anything different for a million public users that are currently using your site.
In general you need a way to say that you are in a debug environment somehow. Either by having an alternative entry point, a url switch or any other way.
In this case I will assume you have 2 entry points. index.php and index2.php index2.php will allow debug verbosity
The X functions will be always available along the code but they will echo information just when debug is enabled.
Installation with composer
add the following to your project composer.json
"require": { "mathiasgrimm/x": "dev-master" }
Thanks
Mathias Grimm