1 | <?php |
||
13 | class Recorder extends Component { |
||
14 | |||
15 | /** |
||
16 | * @var mixed |
||
17 | */ |
||
18 | protected $config = []; |
||
19 | |||
20 | /** |
||
21 | * The constructor |
||
22 | */ |
||
23 | 42 | public function __construct() { |
|
26 | |||
27 | /** |
||
28 | * Records an Exception to the database |
||
29 | * @param Exception $e The exception you want to record |
||
30 | * @return false|ExceptionModel |
||
31 | * @throws RecorderFailedException |
||
32 | */ |
||
33 | 12 | public function record(Exception $e) |
|
67 | |||
68 | /** |
||
69 | * Checks the config to see if you can collect certain information |
||
70 | * @param string $type the config value you want to check |
||
71 | * @return boolean |
||
72 | */ |
||
73 | 9 | private function canCollect($type) { |
|
79 | |||
80 | /** |
||
81 | * @param string $key |
||
82 | * @param Exception $e |
||
83 | * @return array|int|null|string |
||
84 | * @throws Exception |
||
85 | */ |
||
86 | 3 | protected function collect($key, Exception $e = null) { |
|
105 | |||
106 | /** |
||
107 | * Gets the ID of the User that is logged in |
||
108 | * @return integer|null The ID of the User or Null if not logged in |
||
109 | */ |
||
110 | 3 | protected function getUserId() { |
|
118 | |||
119 | /** |
||
120 | * Gets the Method of the Request |
||
121 | * @return string|null Possible values are null or GET, POST, DELETE, PUT, etc... |
||
122 | */ |
||
123 | 3 | protected function getMethod() { |
|
131 | |||
132 | /** |
||
133 | * Gets the input data of the Request |
||
134 | * @return array|null The Input data or null |
||
135 | */ |
||
136 | 3 | protected function getData() { |
|
145 | |||
146 | /** |
||
147 | * Gets the URL of the Request |
||
148 | * @return string|null Returns a URL string or null |
||
149 | */ |
||
150 | 3 | protected function getUrl() { |
|
158 | |||
159 | /** |
||
160 | * Gets the status code of the Exception |
||
161 | * @param Exception $e The Exception to check |
||
162 | * @return string|integer The status code value |
||
163 | */ |
||
164 | 3 | protected function getStatusCode(Exception $e) { |
|
171 | |||
172 | /** |
||
173 | * This function will remove all keys from an array recursively as defined in the config file |
||
174 | * @param array $data The array to remove keys from |
||
175 | * @return void |
||
176 | */ |
||
177 | 9 | protected function excludeKeys(array $data) { |
|
189 | } |
||
190 |