Download the PHP package e2ex/e2ex without Composer

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

E2EX - Semantic PHP Error handling

A simple library for converting PHP Errors to Exceptions and (optionally) for logging PHP Notices, Warnings and Errors with a PSR-3 compatible logger, such as monolog. Enables the unification of application and PHP logs and provides a means to harmonise Error and Exception handling.

Installation with Composer

Add the following line to your composer.json file:

require: "e2ex/e2ex": "0.8.*"

Install:

$ composer.phar update e2ex/e2ex

E2EX should play nice with any PSR-0 autoloader.

Basic Usage

Set E2EX to handle all Errors, Warnings and Notices:

Alternatively, you can pass in a bitmask to set which types should be handled.

Calling register() with no arguments will result in the bitmask being set to the current return value of error_reporting().

Any error types that aren't set to be handled by E2EX will be handled by PHP's built-in error handler, (so long as they fall within the error_reporting range).

Handling Exceptions

Non-fatal Errors will raise an E2EX\ErrorException. These can be handled inside try/catch blocks or with a registered exception handler, which can be a static/instance class method, or a global/namespaced function. Non-fatal error types include E_USER_ERROR and E_RECOVERABLE_ERROR.

Fatal (non-recoverable) Errors will raise an E2EX\FatalErrorException. These can only be handled inside your registered exception handler. Fatal error types include E_ERROR, E_PARSE and E_COMPILE_ERROR.

Both of the Exception types extend PHPs native \ErrorException.

PSR-3 Logging

To enable PSR-3 logging, all that's required is to pass in a PSR-3 compatible logger instance:

If you only want to log Notices and Warnings, pass in boolean false as the second argument when you register the handler.

A context array will be added to each log entry containing the PHP error type (as an integer), the filename, the line number and (optionally) the stack trace as an indexed array of associative arrays. By default, the stack trace will be limited to a depth of 5. You can vary this by passing a 3rd paramater to the register() method, like so:

If you don't want to log stack traces, simply pass in 0 as the 3rd argument.

Note that once PSR-3 logging has been enabled, non-fatal Errors, Notices and Warnings set to be handled by E2EX will not be handled by PHP's built in error handler, and so will not be logged to PHP's error_log.

Caveats

Running the Tests

Install dev dependencies (if not already installed).

Run tests:

$ phpunit tests

Requirements

License

MIT


All versions of e2ex with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.6
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 e2ex/e2ex contains the following files

Loading the files please wait ....