Skip to content
Permalink
Browse files

A cleaner way to check if RequestHandler is loaded

  • Loading branch information...
ADmad committed Nov 24, 2012
1 parent 3083b01 commit 9c0939b888197ce38405256aaa8b59c0b0f4b2d8
Showing with 4 additions and 6 deletions.
  1. +4 −6 lib/Cake/Controller/CakeErrorController.php
@@ -52,14 +52,12 @@ class CakeErrorController extends AppController {
*/
public function __construct($request = null, $response = null) {
parent::__construct($request, $response);
if (
count(Router::extensions()) &&
!array_key_exists('RequestHandler', $this->components) &&
!in_array('RequestHandler', $this->components, true)
$this->constructClasses();
if (count(Router::extensions()) &&
!$this->Components->attached('RequestHandler')
) {
$this->components[] = 'RequestHandler';
$this->RequestHandler = $this->Components->load('RequestHandler');
}
$this->constructClasses();
if ($this->Components->enabled('Auth')) {
$this->Components->disable('Auth');
}

0 comments on commit 9c0939b

Please sign in to comment.
You can’t perform that action at this time.