forked from learnable/php-airbrake-notifier
/
example.php
41 lines (32 loc) · 1.09 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// register Services_Hoptoad for php errors and raised exceptions
require_once 'Services/Hoptoad.php';
Services_Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY");
?>
<?php
// register Services_Hoptoad for php errors and raised exceptions
// when used in your staging environment
require_once 'Services/Hoptoad.php';
Services_Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY", 'staging');
?>
<?php
// register Services_Hoptoad for php errors and raised exceptions
// when used in production and using the Curl transport
require_once 'Services/Hoptoad.php';
Services_Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY", 'production', 'curl');
?>
<?php
// standalone
require_once 'Services/Hoptoad.php';
Services_Hoptoad::$apiKey = "YOUR_HOPTOAD_API_KEY";
$exception = new Custom_Exception('foobar');
Services_Hoptoad::handleException($exception);
?>
<?php
// use Zend_Http_Client
require_once 'Services/Hoptoad.php';
Services_Hoptoad::$apiKey = "YOUR_HOPTOAD_API_KEY";
Services_Hoptoad::$client = "zend";
$exception = new Custom_Exception('foobar');
Services_Hoptoad::handleException($exception);
?>