CakeErrorController.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. 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. if (
  52. count(Router::extensions()) &&
  53. !array_key_exists('RequestHandler', $this->components) &&
  54. !in_array('RequestHandler', $this->components, true)
  55. ) {
  56. $this->components[] = 'RequestHandler';
  57. }
  58. $this->constructClasses();
  59. if ($this->Components->enabled('Auth')) {
  60. $this->Components->disable('Auth');
  61. }
  62. if ($this->Components->enabled('Security')) {
  63. $this->Components->disable('Security');
  64. }
  65. $this->startupProcess();
  66. $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
  67. }
  68. }