mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 11:02:40 +00:00
Making plugin routes load after app routes, closes #1722
This commit is contained in:
parent
95a5b99b0e
commit
5b8865a3a7
5 changed files with 22 additions and 10 deletions
|
@ -53,10 +53,10 @@ class ConsoleShell extends Shell {
|
|||
public function initialize() {
|
||||
App::uses('Dispatcher', 'Routing');
|
||||
$this->Dispatcher = new Dispatcher();
|
||||
$this->models = App::objects('model');
|
||||
$this->models = App::objects('Model');
|
||||
|
||||
foreach ($this->models as $model) {
|
||||
$class = Inflector::camelize(str_replace('.php', '', $model));
|
||||
$class = $model;
|
||||
$this->models[$model] = $class;
|
||||
App::uses($class, 'Model');
|
||||
$this->{$class} = new $class();
|
||||
|
@ -123,7 +123,7 @@ class ConsoleShell extends Shell {
|
|||
$out .= "\t)";
|
||||
$out .= "\n";
|
||||
$out .= 'Alternatively, you can use simple array syntax to test reverse';
|
||||
$out .= 'To reload your routes config (config/routes.php), do the following:';
|
||||
$out .= 'To reload your routes config (Config/routes.php), do the following:';
|
||||
$out .= "\n";
|
||||
$out .= "\tRoutes reload";
|
||||
$out .= "\n";
|
||||
|
@ -342,6 +342,8 @@ class ConsoleShell extends Shell {
|
|||
if (!@include(APP . 'Config' . DS . 'routes.php')) {
|
||||
return false;
|
||||
}
|
||||
CakePlugin::routes();
|
||||
|
||||
Router::parse('/');
|
||||
|
||||
foreach (array_keys(Router::getNamedExpressions()) as $var) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue