From cc6b699db4fe729542ae06447b9c2f8d9a738e98 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 2 Nov 2012 01:55:37 +0530 Subject: [PATCH] Added missing App::uses() statement. Closes #3331 --- lib/Cake/Controller/CakeErrorController.php | 2 ++ lib/Cake/Error/ExceptionRenderer.php | 5 ++--- lib/Cake/Test/Case/Error/ExceptionRendererTest.php | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Controller/CakeErrorController.php b/lib/Cake/Controller/CakeErrorController.php index 3bcbd72ce..c1835fd6e 100644 --- a/lib/Cake/Controller/CakeErrorController.php +++ b/lib/Cake/Controller/CakeErrorController.php @@ -19,6 +19,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppController', 'Controller'); + /** * Error Handling Controller * diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index a404d3be8..3be08d26c 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -142,15 +142,14 @@ class ExceptionRenderer { * @return Controller */ protected function _getController($exception) { + App::uses('AppController', 'Controller'); App::uses('CakeErrorController', 'Controller'); if (!$request = Router::getRequest(true)) { $request = new CakeRequest(); } $response = new CakeResponse(array('charset' => Configure::read('App.encoding'))); try { - if (class_exists('AppController')) { - $controller = new CakeErrorController($request, $response); - } + $controller = new CakeErrorController($request, $response); } catch (Exception $e) { } if (empty($controller)) { diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php index a5704433b..d11c66413 100644 --- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php +++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php @@ -19,7 +19,6 @@ App::uses('ExceptionRenderer', 'Error'); App::uses('Controller', 'Controller'); -App::uses('AppController', 'Controller'); App::uses('Component', 'Controller'); App::uses('Router', 'Routing');