Simple library for communicating with the Opbeat services.
Use Composer to install this library:
composer require madsleejensen/opbeat-php
You are required to provide a configuration handler which implements Illuminate/Contracts/Config/Repository.
Pass an instance of this config handler when initializing the Client
.
Opbeat\Client
will require the following settings:
opbeat.organization_id
(string)opbeat.app_id
(string)opbeat.access_token
(string)
The following settings are optional and have a default value:
opbeat.enable_exception_handler
(boolean, default: true)opbeat.enable_error_handler
(boolean, default: true)
When you've set up your configuration, simply create an instance of Opbeat\Client
. Unless you set enable_exception_handler
or enable_error_handler
to false
, the client will automatically register a handler for both.
$client = new \Opbeat\Client($config);
You can also catch exceptions manually. Opbeat\Client
exposes a catchException
method for this:
public void catchException ( Exception $exception )
If you experience any issues or have ideas for improvements, please open a pull request or an issue.
Pull requests must adhere to the PSR-2 and naming scheme of classes must adhere to PSR-4 with Opbeat
as namespace prefix.