diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index 039d7ae09..c34a3bc81 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -319,12 +319,15 @@ class Controller extends Object { } if (empty($this->uses)) { $this->modelClass = Inflector::singularize($this->name); - } else { - $this->modelClass = current($this->uses); } $this->modelKey = Inflector::underscore($this->modelClass); $this->Components = new ComponentCollection(); + $childMethods = get_class_methods($this); + $parentMethods = get_class_methods('Controller'); + + $this->methods = array_diff($childMethods, $parentMethods); + if ($request instanceof CakeRequest) { $this->setRequest($request); } diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php index 6fceec3d7..2cc41f173 100644 --- a/lib/Cake/Routing/Dispatcher.php +++ b/lib/Cake/Routing/Dispatcher.php @@ -142,7 +142,7 @@ class Dispatcher { } } - return $privateAction || in_array($request->params['action'], get_class_methods('Controller')); + return $privateAction; } /** @@ -159,7 +159,7 @@ class Dispatcher { $controller->constructClasses(); $controller->startupProcess(); - $methods = array_flip(get_class_methods($controller)); + $methods = array_flip($controller->methods); if (!isset($methods[$request->params['action']])) { if ($controller->scaffold !== false) {