ErrorController.php 1.5 KB

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