Example #1
0
 public static function init($config = array(), $set_exception_handler = true, $set_error_handler = true, $report_fatal_errors = true)
 {
     // Heroku support
     // Use env vars for configuration, if set
     if (isset($_ENV['ROLLBAR_ACCESS_TOKEN']) && !isset($config['access_token'])) {
         $config['access_token'] = $_ENV['ROLLBAR_ACCESS_TOKEN'];
     }
     if (isset($_ENV['ROLLBAR_ENDPOINT']) && !isset($config['endpoint'])) {
         $config['endpoint'] = $_ENV['ROLLBAR_ENDPOINT'];
     }
     if (isset($_ENV['HEROKU_APP_DIR']) && !isset($config['root'])) {
         $config['root'] = $_ENV['HEROKU_APP_DIR'];
     }
     self::$instance = new RollbarNotifier($config);
     if ($set_exception_handler) {
         set_exception_handler('Rollbar::report_exception');
     }
     if ($set_error_handler) {
         set_error_handler('Rollbar::report_php_error');
     }
     if ($report_fatal_errors) {
         register_shutdown_function('Rollbar::report_fatal_error');
     }
     if (self::$instance->batched) {
         register_shutdown_function('Rollbar::flush');
     }
 }
Example #2
0
 public static function init($config, $set_exception_handler = true, $set_error_handler = true, $report_fatal_errors = true)
 {
     self::$instance = new RollbarNotifier($config);
     if ($set_exception_handler) {
         set_exception_handler('Rollbar::report_exception');
     }
     if ($set_error_handler) {
         set_error_handler('Rollbar::report_php_error');
     }
     if ($report_fatal_errors) {
         register_shutdown_function('Rollbar::report_fatal_error');
     }
     if (self::$instance->batched) {
         register_shutdown_function('Rollbar::flush');
     }
 }
Example #3
0
 protected function setUp()
 {
     Rollbar::$instance = null;
 }