PHP code example of hexa2k9 / exception-handler

1. Go to this page and download the library: Download hexa2k9/exception-handler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hexa2k9 / exception-handler example snippets


ExceptionHandler::configure(
    array(
        'username'       => 'company',                  // Your Slack Subdomain (e.g. company.slack.com)
        'token'          => '<your token>',             // The Slack Integration Token
        'data_path'      => '/tmp',                     // The Path to store full Exception Traces in
        'webhookChannel' => '#exceptions',              // Your Slack Channel
        'webhookUser'    => 'exception',                // The Username who will post Messages
        'webhookIcon'    => ':ghost:',                  // The Icon for the Username (can be :ghost: or an URL)
        'hostname'       => php_uname('n'),             // The Hostname your Application is running on
        'version'        => '1.0.0',                    // Your Application Version
        'env'            => 'production'                // The Applications Environment (e.g. production or development)
    )
);

set_exception_handler(array('\ExceptionHandler', 'handleException'));