dev-master
9999999-dev https://github.com/ankane/exceptional-phpThe power of Exceptional for PHP
MIT
The Requires
- php >=5.3.0
exception error monitoring
The power of Exceptional for PHP
The power of Exceptional for PHP, (*1)
require "path/to/exceptional.php"; Exceptional::setup("YOUR-API-KEY");
You can turn off exception notifications by passing an empty string as the API key. This is great for development., (*2)
if (PHP_ENV == "production") { $api_key = "YOUR-API-KEY"; } else { $api_key = ""; } Exceptional::setup($api_key);
You can turn on SSL by setting the second parameter to true
., (*3)
Exceptional::setup($api_key, true);
You can blacklist sensitive fields from being submitted to Exceptional:, (*4)
Exceptional::setup($api_key); Exceptional::blacklist(array('password', 'creditcardnumber'));
Exceptional PHP catches both errors and exceptions. You can control which errors are caught. If you want to ignore certain errors, use error_reporting()
. Here's a common setting:, (*5)
error_reporting(E_ALL & ~E_NOTICE); // ignore notices
Custom error and exception handlers are supported - see examples/advanced.php., (*6)
Fatal and parse errors are caught, too - as long the setup file parses correctly., (*7)
Add the following code to your 404 handler to track 404 errors:, (*8)
throw new Http404Error();
$context = array( "user_id" => 1 ); Exceptional::context($context);
See the Exceptional documentation for more details., (*9)
You can include the controller and action names in your exceptions for easier debugging., (*10)
Exceptional::$controller = "welcome"; Exceptional::$action = "index";
You can send exceptions through proxy server (no support for authentication)., (*11)
Exceptional::proxy($host, $port);
The power of Exceptional for PHP
MIT
exception error monitoring