Skip to content

airteltour/whoops-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whoops Slack

Latest Stable Version Latest Unstable Version Total Downloads License Build Status

'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 Airteltour/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 Airteltour\Whoops\SlackHandler($client));
$whoops->register();

Config

new Airteltour\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 Airteltour\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

About

PHP, Whoops Slack Handler.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages