コード例 #1
0
ファイル: rollbar.php プロジェクト: rohichurch/rohichurch-wp
 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');
     }
 }
コード例 #2
0
ファイル: rollbar.php プロジェクト: joelataylor/rollbar
 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');
     }
 }
コード例 #3
0
ファイル: RollbarTest.php プロジェクト: oadam/rollbar-php
 protected function setUp()
 {
     Rollbar::$instance = null;
 }