forked from learnable/php-airbrake-notifier
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename Hoptoad to Airbrake http://robots.thoughtbot.com/post/76654117…
- Loading branch information
Showing
7 changed files
with
64 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Services/Hoptoad/CodeIgniter.php → Services/Airbrake/CodeIgniter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,19 +1,19 @@ | |||
<?php | <?php | ||
require_once('php-hoptoad-notifier/Services/Hoptoad.php'); | require_once('php-airbrake-notifier/Services/Airbrake.php'); | ||
require_once('pheanstalk/pheanstalk_init.php'); | require_once('pheanstalk/pheanstalk_init.php'); | ||
|
|
||
$hoptoad = new Services_Hoptoad(HOPTOAD_API_KEY); | $airbrake = new Services_Airbrake(HOPTOAD_API_KEY); | ||
|
|
||
$k = array_rand($BEANSTALK_SERVERS); | $k = array_rand($BEANSTALK_SERVERS); | ||
$pheanstalk = new Pheanstalk($BEANSTALK_SERVERS[$k]['host'], $BEANSTALK_SERVERS[$k]['port']); | $pheanstalk = new Pheanstalk($BEANSTALK_SERVERS[$k]['host'], $BEANSTALK_SERVERS[$k]['port']); | ||
|
|
||
$pheanstalk->watch('hoptoad')->ignore('default'); | $pheanstalk->watch('airbrake')->ignore('default'); | ||
while($job = $pheanstalk->reserve()) | while($job = $pheanstalk->reserve()) | ||
{ | { | ||
$data = json_decode($job->getData()); | $data = json_decode($job->getData()); | ||
|
|
||
echo date('Y-m-d H:i:s') . ' Processing Error: ' . $data->url . "\n"; | echo date('Y-m-d H:i:s') . ' Processing Error: ' . $data->url . "\n"; | ||
$hoptoad->curlRequest($data->url, $data->headers, $data->body); | $airbrake->curlRequest($data->url, $data->headers, $data->body); | ||
|
|
||
$pheanstalk->delete($job); | $pheanstalk->delete($job); | ||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,41 +1,41 @@ | |||
<?php | <?php | ||
// register Services_Hoptoad for php errors and raised exceptions | // register Services_Airbrake for php errors and raised exceptions | ||
require_once 'Services/Hoptoad.php'; | require_once 'Services/Airbrake.php'; | ||
Services_Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY"); | Services_Airbrake::installHandlers("YOUR_AIRBRAKE_API_KEY"); | ||
?> | ?> | ||
|
|
||
<?php | <?php | ||
// register Services_Hoptoad for php errors and raised exceptions | // register Services_Airbrake for php errors and raised exceptions | ||
// when used in your staging environment | // when used in your staging environment | ||
require_once 'Services/Hoptoad.php'; | require_once 'Services/Airbrake.php'; | ||
Services_Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY", 'staging'); | Services_Airbrake::installHandlers("YOUR_AIRBRAKE_API_KEY", 'staging'); | ||
?> | ?> | ||
|
|
||
<?php | <?php | ||
// register Services_Hoptoad for php errors and raised exceptions | // register Services_Airbrake for php errors and raised exceptions | ||
// when used in production and using the Curl transport | // when used in production and using the Curl transport | ||
require_once 'Services/Hoptoad.php'; | require_once 'Services/Airbrake.php'; | ||
Services_Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY", 'production', 'curl'); | Services_Airbrake::installHandlers("YOUR_AIRBRAKE_API_KEY", 'production', 'curl'); | ||
?> | ?> | ||
|
|
||
<?php | <?php | ||
// standalone | // standalone | ||
require_once 'Services/Hoptoad.php'; | require_once 'Services/Airbrake.php'; | ||
|
|
||
Services_Hoptoad::$apiKey = "YOUR_HOPTOAD_API_KEY"; | Services_Airbrake::$apiKey = "YOUR_AIRBRAKE_API_KEY"; | ||
|
|
||
$exception = new Custom_Exception('foobar'); | $exception = new Custom_Exception('foobar'); | ||
Services_Hoptoad::handleException($exception); | Services_Airbrake::handleException($exception); | ||
?> | ?> | ||
|
|
||
<?php | <?php | ||
// use Zend_Http_Client | // use Zend_Http_Client | ||
require_once 'Services/Hoptoad.php'; | require_once 'Services/Airbrake.php'; | ||
|
|
||
Services_Hoptoad::$apiKey = "YOUR_HOPTOAD_API_KEY"; | Services_Airbrake::$apiKey = "YOUR_AIRBRAKE_API_KEY"; | ||
Services_Hoptoad::$client = "zend"; | Services_Airbrake::$client = "zend"; | ||
|
|
||
$exception = new Custom_Exception('foobar'); | $exception = new Custom_Exception('foobar'); | ||
Services_Hoptoad::handleException($exception); | Services_Airbrake::handleException($exception); | ||
?> | ?> | ||
|
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters