<commit_before># honeybadger-php [![Build Status](https://secure.travis-ci.org/gevans/honeybadger-php.png)](http://travis-ci.org/gevans/honeybadger-php)

honeybadger-php is an unofficial library for reporting application errors to
[Honeybadger](http://honeybadger.io).

## Compatibility

honeybadger-php is developed and tested against PHP versions 5.3 and 5.4.

## Standalone Installation

Add honeybadger-php to your `composer.json`:

```javascript
{
  // ...
  "require": {
    // ...
    "gevans/honeybadger-php": "*"
  }
  // ...
}
```

Then configure `Honeybadger` in your bootstrap/`index.php`/initializers:

```php
<?php

use Honeybadger\Honeybadger;

Honeybadger::$config->values(array(
    'api_key' => '[your-api-key]',
));
```

Your application will then report unhandled errors and exceptions
to Honeybadger. That's it!

## Slim Installation

Add honeybadger-php to your `composer.json`:

```javascript
{
  // ...
  "require": {
    // ...
    "gevans/honeybadger-php": "*"
  }
  // ...
}
```

Call `Honeybadger\Slim::init()` after your application definition:

```php
<?php

$app = new Slim(array(
  // ...
));

$app->add(new Honeybadger\Slim(array(
    'api_key'      => '[your-api-key]',
    'project_root' => realpath(__DIR__),
)));

// ...
$app->run();
```

## Additional Integrations

This library will work well by following the
[standalone installation](https://github.com/gevans/honeybadger-php#standalone-installation)
steps outlined above. However, if you want to integrate your favorite framework,
feel free to send a pull request, using the
[Slim integration](https://github.com/gevans/honeybadger-php/blob/master/lib/Honeybadger/Slim.php)
as a reference.

## Usage

For the most part, Honeybadger works for itself.

It intercepts unhandled errors and uncaught exceptions and sends notifications.

If you want to log arbitrary things which you've caught yourself, you can do
something like this:

```php
<?php

try<commit_msg>Tweak Additional Integrations section<commit_after># honeybadger-php [![Build Status](https://secure.travis-ci.org/gevans/honeybadger-php.png)](http://travis-ci.org/gevans/honeybadger-php)

honeybadger-php is an unofficial library for reporting application errors to
[Honeybadger](http://honeybadger.io).

## Compatibility

honeybadger-php is developed and tested against PHP versions 5.3 and 5.4.

## Standalone Installation

Add honeybadger-php to your `composer.json`:

```javascript
{
  // ...
  "require": {
    // ...
    "gevans/honeybadger-php": "*"
  }
  // ...
}
```

Then configure `Honeybadger` in your bootstrap/`index.php`/initializers:

```php
<?php

use Honeybadger\Honeybadger;

Honeybadger::$config->values(array(
    'api_key' => '[your-api-key]',
));
```

Your application will then report unhandled errors and exceptions
to Honeybadger. That's it!

## Slim Installation

Add honeybadger-php to your `composer.json`:

```javascript
{
  // ...
  "require": {
    // ...
    "gevans/honeybadger-php": "*"
  }
  // ...
}
```

Call `Honeybadger\Slim::init()` after your application definition:

```php
<?php

$app = new Slim(array(
  // ...
));

$app->add(new Honeybadger\Slim(array(
    'api_key'      => '[your-api-key]',
    'project_root' => realpath(__DIR__),
)));

// ...
$app->run();
```

## Additional Integrations

This library will work well by following the
[standalone installation](https://github.com/gevans/honeybadger-php#standalone-installation)
steps outlined above. However, if you want to integrate your favorite framework,
you can use the
[Slim integration](https://github.com/gevans/honeybadger-php/blob/master/lib/Honeybadger/Slim.php)
as a reference. If you've written your own integration that you'd like to share,
send a [pull request](https://github.com/gevans/honeybadger-php/pull/new/master)
adding it to the list:

* *Nothing here yet...*

## Usage

For the most part, Honeybadger works for itself.

It intercepts unhandled errors and uncaught exceptions and sends notifications.

If you want to log arbitrary things which you've caught yourself, you can do
something like this:

```php
<?php

try
{'fraction_non_alphanumeric': 0.1492427943331705, 'fraction_numerical': 0.0019540791402051783, 'mean_word_length': 3.921875, 'pattern_counts': {'":': 8, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3446630', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1357, 'n_words': 356}