CakeErrorController.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. App::uses('AppController', 'Controller');
  23. /**
  24. * Error Handling Controller
  25. *
  26. * Controller used by ErrorHandler to render error views.
  27. *
  28. * @package Cake.Controller
  29. */
  30. class CakeErrorController extends AppController {
  31. /**
  32. * Uses Property
  33. *
  34. * @var array
  35. */
  36. public $uses = array();
  37. /**
  38. * __construct
  39. *
  40. * @param CakeRequest $request
  41. * @param CakeResponse $response
  42. */
  43. public function __construct($request = null, $response = null) {
  44. parent::__construct($request, $response);
  45. $this->constructClasses();
  46. if (count(Router::extensions()) &&
  47. !$this->Components->attached('RequestHandler')
  48. ) {
  49. $this->RequestHandler = $this->Components->load('RequestHandler');
  50. }
  51. if ($this->Components->enabled('Auth')) {
  52. $this->Components->disable('Auth');
  53. }
  54. if ($this->Components->enabled('Security')) {
  55. $this->Components->disable('Security');
  56. }
  57. $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
  58. }
  59. }