Beispiel #1
0
 /**
  * Get a singleton instance of the client.
  *
  * This is the intended way to access the Errbit client.
  *
  * @return [Errbit]
  *   a singleton
  */
 public static function instance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Beispiel #2
0
 /**
  * Wrapper for log function
  * @param array $message
  * @param string $priority
  * @return bool
  */
 public function log($message, $priority = null)
 {
     // If message contains one of ignored messages, shut down
     foreach (self::$ignoredMessages as $ignoredMessage) {
         if (strpos($message[1], $ignoredMessage) !== false) {
             return true;
         }
     }
     // Log to file
     $response = parent::log($message, $priority);
     if (in_array($priority, self::$priorities)) {
         if ($message instanceof \Exception) {
             \Errbit::instance()->notify($message);
         } else {
             \Errbit::instance()->notify(new \Exception($priority . ' ' . $message));
         }
     }
     return $response;
 }
Beispiel #3
0
 function __construct()
 {
     $this->errbit = Errbit::instance();
     $this->errbit->configure(array('api_key' => self::$settings['api_key'], 'host' => self::$settings['host'], 'port' => self::$settings['port'], 'secure' => false, 'project_root' => '/', 'environment_name' => self::$settings['environment_name'], 'params_filters' => array('/password/', '/card_number/'), 'backtrace_filters' => array('#/some/long/path#' => '')));
 }
Author URI: https://github.com/airbrake
Plugin URI: https://github.com/iloveitaly/wordpress-errbit

Description: Errbit lets you discover errors and bugs in your Wordpress install.

Version: 1.1
License: GPL
*/
global $wpdb;
define('AW_TITLE', 'Errbit Wordpress');
define('AW_SLUG', 'errbit-wordpress');
define('AW_DOCROOT', dirname(__FILE__));
define('AW_WEBROOT', str_replace(getcwd(), home_url(), dirname(__FILE__)));
register_activation_hook(__FILE__, 'errbit_wordpress_install');
register_deactivation_hook(__FILE__, 'errbit_wordpress_uninstall');
add_action('admin_menu', 'errbit_wordpress_admin_menu');
include 'classes/install.php';
include 'classes/controller.php';
// TODO should handle the JS errbit include here as well
if (get_option('errbit_wordpress_setting_status')) {
    require_once 'classes/errbit-php/lib/Errbit.php';
    $errbit_api = trim(get_option('errbit_wordpress_setting_apikey'));
    $errbit_url = trim(get_option('errbit_wordpress_setting_url'));
    $errbit_environment_name = trim(get_option('errbit_wordpress_setting_environment_name'));
    $warnings = (int) get_option('errbit_wordpress_setting_warrings');
    $handlers = array('error', 'exception', 'fatal');
    if ($warnings === 0) {
        unset($handlers[0]);
    }
    Errbit::instance()->configure(array('api_key' => $errbit_api, 'host' => $errbit_url, 'environment_name' => $errbit_environment_name))->start($handlers);
}