Download the PHP package brannonh/php-debug without Composer

On this page you can find all versions of the php package brannonh/php-debug. 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 php-debug

php-debug

php-debug is a simple debugging class for use in PHP scripts. Use it when you don't have access to a debugger, like in a customer's environment, or you need to gather complex and/or larger amounts of data that are not feasible to analyze in a debugging session.

Features

Support

This library has not been tested on PHP versions prior to 5.3.29. If you try it, please let us know how it goes by opening a new issue.

If you find problems on any other versions, please also let us know in a new issue.

Usage

To use php-debug, simply drop the Debug.php file somewhere in your source files and include or require it in the file that needs to be debugged. Then, create a new Debug object and use it to gather, save, and log data.

When logging, data is stored in as JSON at your file location of choice (by default, debug.json in the same directory as Debug.php).

API

The following API documentation is sorted alphabetically. To learn the basics and get started quickly, we recommend reading log_all.

__construct($filename, $data, $log_now, $max_entries)

All the parameters of the constructor have default values, so none are necessary to get started with Debug. The $data parameter sets the internal data store and should always be an associative array. The behavior of Debug is undefined when $data is set to a scalar or an object.

Parameters

Parameter Type Required Default Notes
$filename string 'debug.json' The default file is created in the same directory as Debug.php.
$data array array() Use this to initialize the saved data.
$log_now boolean false Log any initialized data immediately.
$max_entries integer 500 The log file will be limited to this many entries (not lines).

Returns

Type Notes
Debug The Debug object

:tophat:

count($key)

Count the number of values in the array or the number of characters in the string stored at $key.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being counted

Returns

Type Notes
integer The number of elements in the array (using count) or string (using strlen)

:tophat:

is_empty($key)

Get the result of PHP's empty() function for the data element stored at $key.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being checked

Returns

Type Notes
boolean Whether or not the element is empty

:tophat:

decrease($key, $val)

Perform -- or -= operations on the data element stored at $key.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being decreased
$val integer 1 The value by which to decrease

Returns

Type Notes
void

:tophat:

get($key)

Obtain the value of the data element stored at $key.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being requested

Returns

Type Notes
mixed The value of the requested data element

:tophat:

increase($key, $val)

Perform ++ or += operations on the data element stored at $key.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being increased
$val integer 1 The value by which to increase

Returns

Type Notes
void

:tophat:

log_all()

Write all stored data elements to the log file.

Parameters

Parameter Type Required Default Notes
void

Returns

Type Notes
void

:tophat:

log_data($keys)

Write the data elements stored at $keys to the log file.

Parameters

Parameter Type Required Default Notes
$keys string | array :heavy_check_mark: The key(s) for the data element(s) being logged (can be a single key or multiple keys in an integer-indexed array )

Returns

Type Notes
void

:tophat:

log($data, $raw)

Write data directly to the log file without saving it as a data element.

log_data interact with saved data elements, but this function skips that step for cases when you just want to log current values. log_all and log_data use this function internally.

Parameters

Parameter Type Required Default Notes
$data mixed :heavy_check_mark: The data element to log (can be a single value or multiple values in an integer-indexed array )
$raw boolean true Whether or not to treat $data as a single value and log it as-is

When this is false, $data is treated as if it had been saved with set(). When this is true, you cannot save multiple values in $data.

Returns

Type Notes
void

:tophat:

merge($key, $data)

Merge the $data array into the data element stored at $key. This is an easy way to update multiple values in a data element at once. Assumes $key references an array.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being merged
$data array :heavy_check_mark: The data being merged into $key

Returns

Type Notes
void

:tophat:

set($key, $data)

Save $data as the value of the data element stored at $key.

Parameters

Parameter Type Required Default Notes
$key string :heavy_check_mark: The key for the data element being saved
$data array :heavy_check_mark: The data being saved into $key

Returns

Type Notes
void

:tophat:


All versions of php-debug 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 brannonh/php-debug contains the following files

Loading the files please wait ....