Skip to content

Commit

Permalink
A cleaner way to check if RequestHandler is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Nov 24, 2012
1 parent 3083b01 commit 9c0939b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/Cake/Controller/CakeErrorController.php
Expand Up @@ -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');
}
Expand Down

0 comments on commit 9c0939b

Please sign in to comment.