Download the PHP package gerardpastor/dumper without Composer

On this page you can find all versions of the php package gerardpastor/dumper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dumper

Dumper

Dumper is a simple and ready to use PHP var dumper.

Essentially, its a print_r() and var_dump() replacement.

Usage

Install the latest version using composer require gerardpastor/dumper

Enabling all dumping functions is as easy as calling enable() method on the main Dumper class:

The first parameter determines what output to use. This can be a predefined string or an instance of OutputInterface.

By default, Dumper includes 3 outputs: dummy, browser and console.

Dumping vars

Dumper defines 3 dumping functions:

dumpVars: Dumps each var in $vars

dump: Dump $var

dumpAll: Dump each argument

All of this functions starting with "e" dumps and ends up the execution.

Dumping backtrace

You can dump current debug backtrace with dumpBacktrace():

Raw var_dump

Aditionally, Dumper provides rawDump function that does a native var_dump inside a <pre> tag.

Configuration

You can configure some default parameters on Dumper.

Accessing Dumper Instance

To configure Dumper you must acces to its instance.

You can access dumper instance when call enable() or by calling getInstance() when Dumper is already enabled.

Setting default max dumping deep

You can set the default max dumping deep by passing to the VarParser:

You can override this value in any call to dump or dumpVars as the second argument:

Limiting the number of stack frames in backtrace dumping

By default, Dumper dumps all stack frames in backtrace. You can limit this number globally by passing to the BacktraceFactory:

You can override this value in any call to dumpBacktrace as the first argument:

Adding excludes to backtrace

Dumper exculdes all namespaces and directories from Dumper, but you can add your own by passing to the BacktraceFactory:

Disabling global functions

You can disable the definition of Dumper as global functions by passing false as the second argument when calling enable().

Then, you can still access dumper functions by calling directly on a dumper instance:

You can enable this global functions at any time by calling defineGlobalFunctions():

Var Tokenizers

Dumper uses tokenizers to convert any variable into a string.

A tokenizer receives a variable and returns a TokenStream (that is a collection of Token)

Dumper provides tokenizers to parse the most generic variable types:

Tokenizer has an accept($var) and a getConfidence() method.

The parser will use the tokenizer with higher confidence from those which accepted the given variable.

Custom Tokenizers

You can add more specific or sophisticated parsing by adding custom tokenizers.

To do that, you must create a class that implements TokenizerInterface and pass to the VarParser:

Afterwards, pass to VarParser:

Take a look at provided tokenizers for more specific examples.

Outputs

Dumper can use diferent outputs to show variables to user.

The provided Outputs are:

Using custom Outputs

You can provide your own output by extending Output class:

And then use it:

Take a look at provided outputs for more specific examples.

Formatters

An Output use a Formatter to format the response. The provided Outputs are:

Using custom Formatters

You can provide your own formatter by implementing FormatterInterface interface:

And then use it:

Take a look at provided formatters for more specific examples.

Using Dumper as Object

The enable() method simply loads a default configuration, but you can instantiate Dumper manually, without using enable():

If you want the global functions to use your own instance, call setInstance() on Dumper:


All versions of dumper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gerardpastor/dumper contains the following files

Loading the files please wait ....