Download the PHP package eloquent/asplode without Composer

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

Asplode

Drop-in exception-based error handling for PHP.

Current version image Current build status image Current coverage status image

Installation and documentation

Usage

The Asplode error handler can be installed with a single statement:

What does Asplode do?

Asplode is a very simple PHP error handler implementation that throws ErrorException exceptions instead of using the default PHP error handling behaviour. This means that all non-fatal runtime errors are presented to the developer in the form of an exception. It also means that any unhandled errors are delivered to a single point: the global exception handler.

Why use Asplode?

Developers need the ability to decide how their code behaves when an error occurs. Exceptions offer the only truly consistent way to report and recover from errors in PHP.

This method of handling errors has proven to be extremely effective. Similar strategies are used in major PHP frameworks such as Laravel. Asplode is a standalone implementation that can be used for any project.

Fatal error handling

While it's not feasible to recover from fatal PHP errors, it is possible to report fatal errors in the same manner as uncaught exceptions.

With Asplode, fatal errors cause a synthesized exception representing the fatal error to be passed to the global exception handler. This allows developers to gracefully inform the user of fatal errors just before the PHP interpreter is shut down.

The Asplode fatal error handler is installed by default, but is only activated if a global exception handler is installed.

To use Asplode without the fatal error handler, use Asplode::installErrorHandler() instead of Asplode::install(). To use only the fatal error handler, use Asplode::installFatalHandler().

Note that attempting to autoload files in the shutdown phase of PHP may be probelmatic; and as such, custom exception handlers should explicitly load their dependencies where possible.

Asserting that the current error handler is compatible

Code that assumes the use of Asplode may not work as expected unless the right type of error handler is installed. For example, code expecting to catch an ErrorException on failure will have unpredictable results if the installed error handler does not throw ErrorException instances.

To ensure that a correctly configured error handler is installed, Asplode provides the Asplode::assertCompatibleHandler() method.

A compatible error handler is any handler that throws ErrorException exceptions. It does not need to be the implementation provided by Asplode.

Managing PHP's handler stacks

PHP's error and exception handlers approximate the behaviour of a stack. However, the interface for manipulating the stack is limited, and quite frankly, poorly implemented.

Asplode includes two classes to aid in management of these stacks, ErrorHandlerStack and ExceptionHandlerStack. Both implement HandlerStackInterface which provides a familiar interface for working with stacks. These classes do not require the use of the Asplode handler; they can be used in a standalone manner to manage the handler stacks.

Migrating existing code to work with Asplode

When the Asplode error handler is installed, the error_reporting setting will no longer have any effect. Notices, warnings, and errors will all result in an exception being thrown. Deprecation notices will not throw an exception, but will still be logged provided that PHP is configured to do so.

Code that has been written to handle legacy-style PHP errors will most likely need to be re-written. As an example, this type of logic:

would need to be rewritten to to handle exceptions:

It's important to note that PHP can be very inconsistent in the way it reports error conditions. Some functions will return a boolean false to indicate an error has occurred; others may require the developer to call additional functions to check for errors; and others still may exhibit entirely non-standard behaviour.

Asplode does not free the developer from the responsibility of reading the PHP documentation, or making sure that they account for all possible error conditions.

Executing legacy code

Sometimes working with code that uses bad practices is unavoidable. A legacy PHP library might be perfectly functional and useful, but it may not anticipate exceptions being thrown when an error occurs.

Asplode's exception and error handler stacks both implement an executeWith() method that allows code to be executed with a different handler than the one currently installed. This method pops all current handlers off the stack temporarily, installs the specified handler (if one is provided) and executes the supplied callback. The original handler is restored after the callback is executed.


All versions of asplode with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
icecave/isolator Version ~2|~3
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 eloquent/asplode contains the following files

Loading the files please wait ....