1 | <?php |
||
17 | class ErrorNotifier extends Module |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | */ |
||
23 | public function __construct() |
||
27 | |||
28 | /** |
||
29 | * Implements hook "route.list" |
||
30 | * @param array $routes |
||
31 | */ |
||
32 | public function hookRouteList(array &$routes) |
||
41 | |||
42 | /** |
||
43 | * Implements hook "cron" |
||
44 | * @param \gplcart\core\Controller $controller |
||
45 | */ |
||
46 | public function hookCron($controller) |
||
50 | |||
51 | /** |
||
52 | * Implements hook "template.output" |
||
53 | * @param string $template |
||
54 | * @param array $data |
||
55 | * @param \gplcart\core\Controller $controller |
||
56 | */ |
||
57 | public function hookTemplate($template, array &$data, $controller) |
||
65 | |||
66 | /** |
||
67 | * Sends last PHP errors via Email |
||
68 | * @param \gplcart\core\Controller $controller |
||
69 | */ |
||
70 | protected function setEmailReport($controller) |
||
81 | |||
82 | /** |
||
83 | * Sends an E-mail |
||
84 | * @param array $settings |
||
85 | * @param array $messages |
||
86 | * @param \gplcart\core\Controller $controller |
||
87 | */ |
||
88 | protected function sendEmail(array $settings, array $messages, $controller) |
||
99 | |||
100 | /** |
||
101 | * Returns an array of PHP errors to send via Email |
||
102 | * @param array $settings |
||
103 | * @param \gplcart\core\Controller $controller |
||
104 | * @return array |
||
105 | */ |
||
106 | protected function getEmailErrors(array $settings, $controller) |
||
118 | |||
119 | /** |
||
120 | * Sets live error reporting |
||
121 | * @param array $data |
||
122 | * @param \gplcart\core\Controller $controller |
||
123 | */ |
||
124 | protected function setLiveReport(array &$data, $controller) |
||
139 | |||
140 | /** |
||
141 | * Prepare an array of messages |
||
142 | * @param array $messages |
||
143 | * @param array $settings |
||
144 | * @param \gplcart\core\Controller $controller |
||
145 | */ |
||
146 | protected function prepareMessages(&$messages, $settings, $controller) |
||
170 | |||
171 | /** |
||
172 | * Returns an array of PHP errors for live reporting |
||
173 | * @param array $settings |
||
174 | * @param \gplcart\core\Controller $controller |
||
175 | * @return array |
||
176 | */ |
||
177 | protected function getLiveErrors(array $settings, $controller) |
||
195 | |||
196 | /** |
||
197 | * Returns an array of formatted error messages |
||
198 | * @param array $errors |
||
199 | * @param \gplcart\core\Controller $controller |
||
200 | * @return array |
||
201 | */ |
||
202 | protected function getFormattedErrors(array $errors, $controller) |
||
216 | |||
217 | } |
||
218 |