Skip to content

Commit

Permalink
Revert "Refactoring Dispatcher::_isPrivate to directly check for cont…
Browse files Browse the repository at this point in the history
…roller methods, doing in in the controller could be unnecessary"

This reverts commit c431ddd.

Conflicts:

	lib/Cake/Routing/Dispatcher.php
  • Loading branch information
lorenzo committed Feb 22, 2011
1 parent b1e007f commit a9d2078
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/Cake/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,15 @@ public function __construct($request = null) {
}
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);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Routing/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected function _isPrivateAction($request) {
}
}

return $privateAction || in_array($request->params['action'], get_class_methods('Controller'));
return $privateAction;
}

/**
Expand All @@ -159,7 +159,7 @@ protected function _invoke(Controller $controller, CakeRequest $request) {
$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) {
Expand Down

0 comments on commit a9d2078

Please sign in to comment.