Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base: master
...
compare: master
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 11 additions and 11 deletions.
  1. +11 −11 airbrake.notifier.php
22 airbrake.notifier.php
View
@@ -8,12 +8,12 @@
*/
class AirbrakeNotifier {
- const NOTIFIER_NAME = 'Airbrake Notifier Client for PHP';
- const NOTIFIER_VERSION = '1.1.0';
- const NOTIFIER_URL = 'https://github.com/rentjuice/airbrake-php-client';
+ public static $notifierName = 'Airbrake Notifier Client for PHP';
+ public static $notifierVersion = '1.1.0';
+ public static $notifierUrl = 'https://github.com/rentjuice/airbrake-php-client';
- const API_BASE_URL = 'http://airbrake.io';
- const API_VERSION = '2.2';
+ public static $apiBaseUrl = 'http://airbrake.io';
+ public static $apiVersion = '2.2';
/**
* @var bool Toggles error logging for the lifetime of notifier
@@ -87,7 +87,7 @@ public function notifyException(Exception $exception, array $extra_data = array(
*/
public function notify($message, $exception_type, array $backtrace = array(), array $extra_data = array()) {
$notice = self::createNoticeXml($message, $exception_type, $backtrace, $extra_data);
- $version = intval(self::API_VERSION);
+ $version = intval(self::$apiVersion);
list($info, $response) = $this->execute("/notifier_api/v{$version}/notices", $notice);
$noticeUrl = $info->success ? (string)$response->url[0] : '';
$noticeId = $info->success ? (string)$response->id[0] : '';
@@ -131,14 +131,14 @@ public function createNoticeXml($message, $exception_type, array $backtrace = ar
// create the top-level notice
$notice = new SimpleXMLElement('<notice></notice>');
- $notice->addAttribute('version', self::API_VERSION);
+ $notice->addAttribute('version', self::$apiVersion);
$notice->addChild('api-key', $this->apiKey);
// declare who is sending the error (aka the "notifier")
$notifier = $notice->addChild('notifier');
- $notifier->addChild('name', self::NOTIFIER_NAME);
- $notifier->addChild('version', self::NOTIFIER_VERSION);
- $notifier->addChild('url', self::NOTIFIER_URL);
+ $notifier->addChild('name', self::$notifierName);
+ $notifier->addChild('version', self::$notifierVersion);
+ $notifier->addChild('url', self::$notifierUrl);
// track the request that caused this error
$component = self::escape(self::fetch($backtrace[0], 'class', __CLASS__));
@@ -227,7 +227,7 @@ public function createNoticeXml($message, $exception_type, array $backtrace = ar
* @param string $root The root API URL to use
* @return array The info object and the parsed server response
*/
- private function execute($path, $payload = null, $root = self::API_BASE_URL) {
+ private function execute($path, $payload = null, $root = self::$apiBaseUrl) {
$url = implode('/', array($root, $path));
$transport = curl_init();

No commit comments for this range

Something went wrong with that request. Please try again.