A cleaner way to check if RequestHandler is loaded

This commit is contained in:
ADmad 2012-11-25 02:43:50 +05:30
parent 3083b01f7d
commit 9c0939b888

View file

@ -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->components[] = 'RequestHandler';
}
$this->constructClasses();
if (count(Router::extensions()) &&
!$this->Components->attached('RequestHandler')
) {
$this->RequestHandler = $this->Components->load('RequestHandler');
}
if ($this->Components->enabled('Auth')) {
$this->Components->disable('Auth');
}