Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A cleaner way to check if RequestHandler is loaded

  • Loading branch information...
commit 9c0939b888197ce38405256aaa8b59c0b0f4b2d8 1 parent 3083b01
@ADmad ADmad authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 lib/Cake/Controller/CakeErrorController.php
View
10 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');
}
Please sign in to comment.
Something went wrong with that request. Please try again.