mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Revert "Refactoring Dispatcher::_isPrivate to directly check for controller methods, doing in in the controller could be unnecessary"
This reverts commit c431ddd22c
.
Conflicts:
lib/Cake/Routing/Dispatcher.php
This commit is contained in:
parent
b1e007f231
commit
a9d2078d25
2 changed files with 7 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue