mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating ExceptionRenderer and CakeErrorHandler for Controller changes.
This commit is contained in:
parent
173e043eaf
commit
04147caca8
2 changed files with 6 additions and 4 deletions
|
@ -22,8 +22,8 @@ class CakeErrorController extends AppController {
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($request = null) {
|
||||
parent::__construct($request);
|
||||
public function __construct($request = null, $response = null) {
|
||||
parent::__construct($request, $response);
|
||||
$this->constructClasses();
|
||||
$this->Components->trigger('initialize', array(&$this));
|
||||
$this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
App::uses('Sanitize', 'Utility');
|
||||
App::uses('Router', 'Routing');
|
||||
App::uses('CakeResponse', 'Network');
|
||||
|
||||
/**
|
||||
* Exception Renderer.
|
||||
|
@ -148,10 +149,11 @@ class ExceptionRenderer {
|
|||
if (!$request = Router::getRequest(false)) {
|
||||
$request = new CakeRequest();
|
||||
}
|
||||
$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
|
||||
try {
|
||||
$controller = new CakeErrorController($request);
|
||||
$controller = new CakeErrorController($request, $response);
|
||||
} catch (Exception $e) {
|
||||
$controller = new Controller($request);
|
||||
$controller = new Controller($request, $response);
|
||||
$controller->viewPath = 'Errors';
|
||||
}
|
||||
return $controller;
|
||||
|
|
Loading…
Reference in a new issue