1. Go to this page and download the library: Download airbrake/phpbrake 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/ */
airbrake / phpbrake example snippets
// Create new Notifier instance.
$notifier = new Airbrake\Notifier([
'projectId' => 12345, // FIX ME
'projectKey' => 'abcdefg' // FIX ME
]);
// Set global notifier instance.
Airbrake\Instance::set($notifier);
// Register error and exception handlers.
$handler = new Airbrake\ErrorHandler($notifier);
$handler->register();
// Somewhere in the app...
try {
throw new Exception('hello from phpbrake');
} catch(Exception $e) {
Airbrake\Instance::notify($e);
}