Base for a static organization website

CakeErrorController.php 1.7KB

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