2017 © Pedro Peláez
 

library dump

A system for generating structure information about nested variables for use including screen display

image

cruxoft/dump

A system for generating structure information about nested variables for use including screen display

  • Wednesday, March 14, 2018
  • by irwtdvoys
  • Repository
  • 1 Watchers
  • 1 Stars
  • 40 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 43 % Grown

The README.md

Dump (0.3.2)

What is it?

An alternative to var_dump or print_r for generating structure information about variables to then be output., (*1)

Installation

Can be installed using composer by running the following:, (*2)

$ composer require cruxoft/dump

Usage

For details on full basic usage and more complex examples see the examples/ folder., (*3)

Output Function

Some simple output based usage examples of the built in dump() function would be as follows:, (*4)

use function Cruxoft\dump;

dump(array("one", "two", 3));
dump(true);
dump("Hello World");

Which would output:, (*5)

array(3):
(
    [0] string(3): "one"
    [1] string(3): "two"
    [2] integer: 3
)
boolean: true
string(11): "Hello World"

The dump method can take an optional options parameter as a bitwise value of the required options. Available options are:, (*6)

  • INCLUDE_LOCATION: Gives the file and line number of the dump call.
  • DIE_AFTER: Calls die() after the dump method is completed.
use Cruxoft\Dump\Options;
use function Cruxoft\dump;

dump("Hello World", Options::INCLUDE_LOCATION);
examples/file.php@4
string(11): "Hello World"

Development

Docker

If your local environment does not have an upto date version of PHP installed there is a docker environment is included in the codebase for quickly building a development/testing environment., (*7)

Your installed PHP version can be found with the following command:, (*8)

$ php -v

PHP 8.0.7 (cli) (built: Jun 23 2021 12:34:03) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies

It uses the latest PHP8 FPM image with composer added and can be built and entered:, (*9)

$ cd docker
$ docker-compose -p dump up -d
$ docker exec -it dump_php_1 bash

The container can be torn down with:, (*10)

$ docker-compose stop

Road Map

  • Ability to specify formatting parameters for output of dump function
  • Additional built-in conversions of structure data (json, xml, etc)
  • Coloured output
  • Handling recursion
  • Options

The Versions

14/03 2018

dev-develop

dev-develop

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams

14/03 2018

dev-master

9999999-dev

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams

14/03 2018

0.2.2

0.2.2.0

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams

07/03 2018

0.2.1

0.2.1.0

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams

01/03 2018

dev-feature/php-update

dev-feature/php-update

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams

01/03 2018

0.2.0

0.2.0.0

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams

15/02 2018

0.1.0

0.1.0.0

A system for generating structure information about nested variables for use including screen display

  Sources   Download

Apache-2.0

The Development Requires

by Steve Adams