CakeErrorController.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 MIT License (http://www.opensource.org/licenses/mit-license.php)
  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. * Controller name
  33. *
  34. * @var string
  35. */
  36. public $name = 'CakeError';
  37. /**
  38. * Uses Property
  39. *
  40. * @var array
  41. */
  42. public $uses = array();
  43. /**
  44. * __construct
  45. *
  46. * @param CakeRequest $request
  47. * @param CakeResponse $response
  48. */
  49. public function __construct($request = null, $response = null) {
  50. parent::__construct($request, $response);
  51. $this->constructClasses();
  52. if (count(Router::extensions()) &&
  53. !$this->Components->attached('RequestHandler')
  54. ) {
  55. $this->RequestHandler = $this->Components->load('RequestHandler');
  56. }
  57. if ($this->Components->enabled('Auth')) {
  58. $this->Components->disable('Auth');
  59. }
  60. if ($this->Components->enabled('Security')) {
  61. $this->Components->disable('Security');
  62. }
  63. $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
  64. }
  65. }