1: <?php
2: /**
3: * Error Handling Controller
4: *
5: * Controller used by ErrorHandler to render error views.
6: *
7: * PHP 5
8: *
9: * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
10: * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11: *
12: * Licensed under The MIT License
13: * For full copyright and license information, please see the LICENSE.txt
14: * Redistributions of files must retain the above copyright notice.
15: *
16: * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
17: * @link http://cakephp.org CakePHP(tm) Project
18: * @package Cake.Controller
19: * @since CakePHP(tm) v 2.0
20: * @license http://www.opensource.org/licenses/mit-license.php MIT License
21: */
22:
23: App::uses('AppController', 'Controller');
24:
25: /**
26: * Error Handling Controller
27: *
28: * Controller used by ErrorHandler to render error views.
29: *
30: * @package Cake.Controller
31: */
32: class CakeErrorController extends AppController {
33:
34: /**
35: * Controller name
36: *
37: * @var string
38: */
39: public $name = 'CakeError';
40:
41: /**
42: * Uses Property
43: *
44: * @var array
45: */
46: public $uses = array();
47:
48: /**
49: * __construct
50: *
51: * @param CakeRequest $request
52: * @param CakeResponse $response
53: */
54: public function __construct($request = null, $response = null) {
55: parent::__construct($request, $response);
56: $this->constructClasses();
57: if (count(Router::extensions()) &&
58: !$this->Components->attached('RequestHandler')
59: ) {
60: $this->RequestHandler = $this->Components->load('RequestHandler');
61: }
62: if ($this->Components->enabled('Auth')) {
63: $this->Components->disable('Auth');
64: }
65: if ($this->Components->enabled('Security')) {
66: $this->Components->disable('Security');
67: }
68: $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
69: }
70:
71: }
72: