- Setup error and exception handlers
- Setup custom callbacks
RawErrorHandler is available via Composer/Packagist.
Add "rawphp/raw-error-handler": "0.*@dev"
to the require block in your composer.json and then run composer install
.
{
"require": {
"rawphp/raw-error-handler": "0.*@dev"
}
}
You can also simply run the following from the command line:
composer require rawphp/raw-error-handler "0.*@dev"
Alternatively, just copy the contents of the RawErrorHandler folder into somewhere that's in your PHP include_path
setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub.
<?php
use RawPHP\RawErrorHandler\ErrorHandler;
// optional configuration
$config = array(
'error_callback' => array( $this, 'errorCallback' ),
'exception_callback' => array( $this, 'exceptionCallback' ),
'shutdown_callback' => array( $this, 'shutdownCallback' ),
);
// instantiate error handler
$handler = new ErrorHandler( );
// config array is optional
$handler->init( $config );
// callbacks
public function errorCallback( $error )
{
// handle the error trace
}
public function exceptionCallback( $exception )
{
// handle the exception trace
}
public function shutdownCallback( )
{
// do any required cleanup
}
This package is licensed under the MIT. Read LICENSE for information on the software availability and distribution.
Please submit bug reports, suggestions and pull requests to the GitHub issue tracker.
- Updated to PHP 5.3.
- Updated to work with the latest rawphp/rawbase package.
- Implemented the hook system.
- Removed
init()
call from constructor.
- Initial Code Commit.