1
|
|
|
<?php |
|
|
|
|
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
|
|
|
|
5
|
|
|
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org) |
6
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
|
|
|
|
7
|
|
|
* |
8
|
|
|
* Licensed under The MIT License |
9
|
|
|
* For full copyright and license information, please see the LICENSE.txt |
10
|
|
|
* Redistributions of files must retain the above copyright notice. |
11
|
|
|
* |
12
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
|
|
|
|
13
|
|
|
* @link https://cakephp.org CakePHP(tm) Project |
|
|
|
|
14
|
|
|
* @since 3.3.4 |
|
|
|
|
15
|
|
|
* @license https://opensource.org/licenses/mit-license.php MIT License |
|
|
|
|
16
|
|
|
*/ |
|
|
|
|
17
|
|
|
namespace App\Controller; |
18
|
|
|
|
19
|
|
|
use Cake\Event\EventInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Error Handling Controller |
23
|
|
|
* |
24
|
|
|
* Controller used by ExceptionRenderer to render error responses. |
25
|
|
|
*/ |
|
|
|
|
26
|
|
|
class ErrorController extends AppController |
27
|
|
|
{ |
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Initialization hook method. |
30
|
|
|
* |
31
|
|
|
* @return void |
|
|
|
|
32
|
|
|
*/ |
33
|
4 |
|
public function initialize(): void |
|
|
|
|
34
|
|
|
{ |
|
|
|
|
35
|
4 |
|
$this->loadComponent('RequestHandler'); |
36
|
4 |
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* beforeFilter callback. |
|
|
|
|
40
|
|
|
* |
41
|
|
|
* @param \Cake\Event\EventInterface $event Event. |
|
|
|
|
42
|
|
|
* @return \Cake\Http\Response|null|void |
|
|
|
|
43
|
|
|
*/ |
44
|
4 |
|
public function beforeFilter(EventInterface $event) |
45
|
|
|
{ |
|
|
|
|
46
|
4 |
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* beforeRender callback. |
|
|
|
|
50
|
|
|
* |
51
|
|
|
* @param \Cake\Event\EventInterface $event Event. |
|
|
|
|
52
|
|
|
* @return \Cake\Http\Response|null|void |
|
|
|
|
53
|
|
|
*/ |
54
|
4 |
|
public function beforeRender(EventInterface $event) |
55
|
|
|
{ |
|
|
|
|
56
|
4 |
|
parent::beforeRender($event); |
57
|
|
|
|
58
|
4 |
|
$this->viewBuilder()->setTemplatePath('Error'); |
59
|
4 |
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* afterFilter callback. |
|
|
|
|
63
|
|
|
* |
64
|
|
|
* @param \Cake\Event\EventInterface $event Event. |
|
|
|
|
65
|
|
|
* @return \Cake\Http\Response|null|void |
|
|
|
|
66
|
|
|
*/ |
67
|
4 |
|
public function afterFilter(EventInterface $event) |
68
|
|
|
{ |
|
|
|
|
69
|
4 |
|
} |
|
|
|
|
70
|
|
|
} |
71
|
|
|
|