PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 154
Lasso Lite – Affiliate Link Manager & Product Displays v154
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
simple-urls / libs / Raven / Breadcrumbs / ErrorHandler.php

ErrorHandler.php in Lasso Lite – Affiliate Link Manager & Product Displays 154, at libs/Raven/Breadcrumbs/ErrorHandler.php

46 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Raven_Breadcrumbs_ErrorHandler
4 {
5 protected $existingHandler;
6
7 /**
8 * @var Raven_Client the client object that sends the message to the server
9 */
10 protected $ravenClient;
11
12 /**
13 * @param Raven_Client $ravenClient
14 */
15 public function __construct(Raven_Client $ravenClient)
16 {
17 $this->ravenClient = $ravenClient;
18 }
19
20 public function handleError($code, $message, $file = '', $line = 0, $context = array())
21 {
22 $this->ravenClient->breadcrumbs->record(array(
23 'category' => 'error_reporting',
24 'message' => $message,
25 'level' => $this->ravenClient->translateSeverity($code),
26 'data' => array(
27 'code' => $code,
28 'line' => $line,
29 'file' => $file,
30 ),
31 ));
32
33 if ($this->existingHandler !== null) {
34 return call_user_func($this->existingHandler, $code, $message, $file, $line, $context);
35 } else {
36 return false;
37 }
38 }
39
40 public function install()
41 {
42 $this->existingHandler = set_error_handler(array($this, 'handleError'), E_ALL);
43 return $this;
44 }
45 }
46