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) |
||
64 | |||
65 | /** |
||
66 | * Sends last PHP errors via Email |
||
67 | * @param \gplcart\core\Controller $controller |
||
68 | */ |
||
69 | protected function setEmailReport($controller) |
||
79 | |||
80 | /** |
||
81 | * Sends an E-mail |
||
82 | * @param array $settings |
||
83 | * @param array $messages |
||
84 | * @param \gplcart\core\Controller $controller |
||
85 | */ |
||
86 | protected function sendEmail(array $settings, array $messages, $controller) |
||
97 | |||
98 | /** |
||
99 | * Returns an array of PHP errors to send via Email |
||
100 | * @param array $settings |
||
101 | * @param \gplcart\core\Controller $controller |
||
102 | * @return array |
||
103 | */ |
||
104 | protected function getEmailErrorMessages(array $settings, $controller) |
||
116 | |||
117 | /** |
||
118 | * Sets live error reporting |
||
119 | * @param array $data |
||
120 | * @param \gplcart\core\Controller $controller |
||
121 | */ |
||
122 | protected function setLiveReport(array &$data, $controller) |
||
137 | |||
138 | /** |
||
139 | * Prepare an array of messages |
||
140 | * @param array $messages |
||
141 | * @param array $settings |
||
142 | * @param \gplcart\core\Controller $controller |
||
143 | */ |
||
144 | protected function prepareMessages(&$messages, $settings, $controller) |
||
167 | |||
168 | /** |
||
169 | * Returns an array of PHP errors for live reporting |
||
170 | * @param array $settings |
||
171 | * @param \gplcart\core\Controller $controller |
||
172 | * @return array |
||
173 | */ |
||
174 | protected function getLiveErrorMessages(array $settings, $controller) |
||
192 | |||
193 | /** |
||
194 | * Returns an array of formatted error messages |
||
195 | * @param array $errors |
||
196 | * @param \gplcart\core\Controller $controller |
||
197 | * @return array |
||
198 | */ |
||
199 | protected function getFormattedErrorMessages(array $errors, $controller) |
||
212 | |||
213 | } |
||
214 |