CakeErrorController.php 1.7 KB

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