Airbrake Silex Extension
Airbrake service provider for Silex and [php-airbrake][3]., (*1)
Installation
composer.json:, (*2)
{
"require": {
"dbtlr/php-airbrake" : "dev-master",
"merqlove/airbrake-silex-service-provider" : "dev-master"
}
}
$ wget http://getcomposer.org/composer.phar
$ php composer.phar install
Registering
use Merqlove\Silex\Provider\AirbrakeServiceProvider;
$app->register(new AirbrakeServiceProvider(), array(
'airbrake.api_key' => 'SOME_KEY', //required
'airbrake.options' => array(
'secure' => false,
), // optional
));
Using
// Send just an error message
$app['airbrake']->notifyOnError('My error message');
// Send an exception that may have been generated or caught.
try {
throw new Exception('This is my exception');
} catch (Exception $exception) {
$app['airbrake']->notifyOnException($exception);
}
License
The Airbrake Silex Extension is licensed under the MIT license., (*3)