oponiti / whoops-slack
Whoops Slack Handler.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 2 177
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 0
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.0
- filp/whoops: ^1.1|^2
- maknz/slack: ^1.7
Requires (Dev)
- mockery/mockery: ^0.9.4
- phpunit/phpunit: ^4.8
This package is not auto-updated.
Last update: 2020-02-27 01:12:07 UTC
README
'Whoops Slack' is a handler for Whoops. It sends message to Slack when error is occured.
Installing
Use Composer to install Whoops into your project:
composer require oponiti/whoops-slack
Usage
$client = new Maknz\Slack\Client('https://hooks.slack.com/services/T00000000/B00000000/xxxxxxxxxxxxxxxxxxxxxxxx', [ 'username' => 'your-user-name', 'channel' => '#your-channel' ]); $whoops = new Whoops\Run; $whoops->pushHandler(new Oponiti\Whoops\SlackHandler($client)); $whoops->register();
Config
new Oponiti\Whoops\SlackHandler($client, [ 'template' => __DIR__ . '/other/yours.template.php', 'max_array_depth' => 3, 'max_array_count' => 5, ]);
max_array_depth
Array value's maximum depth. You will show the message like below.
max_array_depth = 2
Array[
[depth1] => Array[
[depth2] => Array[
...many depth...
],
],
],
max_array_count
Array value's maximum count. You will show the message like below.
max_array_count = 3
Array[
[0] => Array[],
[1] => Array[],
[2] => Array[],
...many count...
],
Filter
$handler = new Oponiti\Whoops\SlackHandler($client); $handler->filter(function (\Exception $exception, \Whoops\Exception\Inspector $inspector) { if ($exception instanceof \Some\Notice\Exception) { return false; } return true; });
Offering Infomation
- File name and line
- Error message
- $_SERVER
- $_POST
- $_GET
- Backtrace