madsleejensen/opbeat-php

Opbeat wrapper for PHP

v2.1.4 2016-04-07 09:47 UTC

This package is not auto-updated.

Last update: 2024-10-26 17:55:57 UTC


README

Simple library for communicating with the Opbeat services.

Installation

Use Composer to install this library:

composer require madsleejensen/opbeat-php

Configuration

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)

Enable Client

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);

Manually Catch Exception

You can also catch exceptions manually. Opbeat\Client exposes a catchException method for this:

public void catchException ( Exception $exception )

Contributing

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.