mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
A cleaner way to check if RequestHandler is loaded
This commit is contained in:
parent
3083b01f7d
commit
9c0939b888
1 changed files with 5 additions and 7 deletions
|
@ -52,14 +52,12 @@ class CakeErrorController extends AppController {
|
||||||
*/
|
*/
|
||||||
public function __construct($request = null, $response = null) {
|
public function __construct($request = null, $response = null) {
|
||||||
parent::__construct($request, $response);
|
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();
|
$this->constructClasses();
|
||||||
|
if (count(Router::extensions()) &&
|
||||||
|
!$this->Components->attached('RequestHandler')
|
||||||
|
) {
|
||||||
|
$this->RequestHandler = $this->Components->load('RequestHandler');
|
||||||
|
}
|
||||||
if ($this->Components->enabled('Auth')) {
|
if ($this->Components->enabled('Auth')) {
|
||||||
$this->Components->disable('Auth');
|
$this->Components->disable('Auth');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue