mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Making helper command be able to replace plugin helpers too.
This commit is contained in:
parent
4bfa345192
commit
02d9e41b2a
1 changed files with 11 additions and 1 deletions
|
@ -25,7 +25,17 @@ class UpgradeShell extends Shell {
|
|||
}
|
||||
|
||||
$patterns = array();
|
||||
foreach (App::objects('helper') as $helper) {
|
||||
$helpers = App::objects('helper');
|
||||
$plugins = App::objects('plugin');
|
||||
$pluginHelpers = array();
|
||||
foreach ($plugins as $plugin) {
|
||||
$pluginHelpers = array_merge(
|
||||
$pluginHelpers,
|
||||
App::objects('helper', App::pluginPath($plugin) . DS . 'views' . DS . 'helpers' . DS, false)
|
||||
);
|
||||
}
|
||||
$helpers = array_merge($pluginHelpers, $helpers);
|
||||
foreach ($helpers as $helper) {
|
||||
$oldHelper = strtolower(substr($helper, 0, 1)).substr($helper, 1);
|
||||
$patterns[] = array(
|
||||
"\${$oldHelper} to \$this->{$helper}",
|
||||
|
|
Loading…
Reference in a new issue