2017 © Pedro Peláez
 

library x

Quick debug for web and cli environment

image

mathiasgrimm/x

Quick debug for web and cli environment

  • Thursday, September 1, 2016
  • by mathiasgrimm
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,264 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

X

  • X is a collection of php functions to quickly debug php while working with web or cli (command line interface), (*1)

  • X is a replacement for the common php print_r/var_dump debug approach, (*2)

  • X provides a convenient way to debug in live environment, (*3)

Usage

";
print_r($GLOBALS);
print_r($_POST);
print_r($_GET);
echo "
"; // X x($GLOBAS, $_POST, $_GET); // ------------------------------------ // common php echo "
";
foreach ($_FILES as $file) {
    print_r($file);
}
echo "
"; // X foreach ($_FILES as $file) { x($file); } // ------------------------------------ // common php echo "
";
print_r($_REQUEST);
print_r($_POST);
die;

// X
xd($_REQUEST, $_POST);

```

Output
-------
```php
$aLang = array(
   'PHP',
   'Java',
   'JavaScript'
);

x(1, 2, 3, $aLang);

```

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 ```php

The X functions will be always available along the code but they will echo information just when debug is enabled., (*4)

Installation with composer

add the following to your project composer.json, (*5)

    "require": {
        "mathiasgrimm/x": "dev-master"
    }

Packagist, (*6)

Thanks, (*7)

Mathias Grimm, (*8)

The Versions

01/09 2016

dev-master

9999999-dev https://github.com/mathiasgrimm/x/

Quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug

01/09 2016

v1.4.1

1.4.1.0 https://github.com/mathiasgrimm/x/

Quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug

01/09 2016

v1.4.0

1.4.0.0 https://github.com/mathiasgrimm/x/

Quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug

22/03 2015

v1.3

1.3.0.0 https://github.com/mathiasgrimm/x/

quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug

22/03 2015

v1.2

1.2.0.0 https://github.com/mathiasgrimm/x/

quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug

20/03 2015

v1.1

1.1.0.0 https://github.com/mathiasgrimm/x/

quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug

13/01 2015

1.0

1.0.0.0 https://github.com/mathiasgrimm/x/

quick debug for web and cli environment

  Sources   Download

The Requires

  • php >=5.3.0

 

debug