From 36ccefa51fc6812f861bc06fdd647215007116b7 Mon Sep 17 00:00:00 2001 From: phpnut Date: Fri, 3 Feb 2006 02:37:59 +0000 Subject: [PATCH] Merging fixes and enhancements into trunk Revision: [1910] Adding fix to correct paths when using plugins Revision: [1909] Adding a fix to load plugin AppController if AppController is not present in memory already git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1911 3807eeeb-6ff5-0310-8944-8be069107fe0 --- VERSION.txt | 2 +- cake/basics.php | 15 +++++++++++++++ cake/dispatcher.php | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 8d4642e50..7c9256ed3 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -0.10.8.1908 RC 4 \ No newline at end of file +0.10.8.1911 RC 4 \ No newline at end of file diff --git a/cake/basics.php b/cake/basics.php index 6b6f04d76..54387f6dd 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -252,6 +252,21 @@ function loadController ($name) */ function loadPluginController ($plugin, $controller) { + if(!class_exists('AppController')) + { + if(file_exists(APP.'plugins'.DS.$plugin.DS.'app_controller.php')) + { + require_once(APP.'plugins'.DS.$plugin.DS.'app_controller.php'); + } + elseif(file_exists(APP.'app_controller.php')) + { + require_once(APP.'app_controller.php'); + } + else + { + require_once(CAKE.'app_controller.php'); + } + } if(!class_exists($controller.'Controller')) { diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 8a6bf6326..86cc89d33 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -91,7 +91,7 @@ class Dispatcher extends Object $missingAction = false; $missingView = false; $privateAction = false; - + $this->base = $this->baseUrl(); if (empty($params['controller'])) { $missingController = true; @@ -128,6 +128,7 @@ class Dispatcher extends Object $params = $this->_restructureParams($params); $this->plugin = Inflector::underscore($ctrlName).DS; loadPluginModels($this->plugin); + $this->base = $this->base.'/'.Inflector::underscore($ctrlName); } } } @@ -150,7 +151,7 @@ class Dispatcher extends Object } } - $this->base = $this->baseUrl(); + if ($missingController) {