mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge pull request #141 from luisarmando/componentsUpgrade
Update component task, make components extend Component instead of Object
This commit is contained in:
commit
f671be60d1
1 changed files with 27 additions and 0 deletions
|
@ -421,6 +421,29 @@ class UpgradeShell extends Shell {
|
||||||
$this->_filesRegexpUpdate($patterns);
|
$this->_filesRegexpUpdate($patterns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update components.
|
||||||
|
*
|
||||||
|
* - Make components that extend Object to extend Component.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function components() {
|
||||||
|
$this->_paths = App::Path('Controller/Component');
|
||||||
|
if (!empty($this->params['plugin'])) {
|
||||||
|
$this->_paths = App::Path('Controller/Component', $this->params['plugin']);
|
||||||
|
}
|
||||||
|
$patterns = array(
|
||||||
|
array(
|
||||||
|
'*Component extents Object to *Component extends Component',
|
||||||
|
'/([a-zA-Z]*Component extends) Object/',
|
||||||
|
'\1 Component'
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->_filesRegexpUpdate($patterns);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move application php files to where they now should be
|
* Move application php files to where they now should be
|
||||||
*
|
*
|
||||||
|
@ -636,6 +659,10 @@ class UpgradeShell extends Shell {
|
||||||
->addSubcommand('constants', array(
|
->addSubcommand('constants', array(
|
||||||
'help' => "Replace Obsolete constants",
|
'help' => "Replace Obsolete constants",
|
||||||
'parser' => $subcommandParser
|
'parser' => $subcommandParser
|
||||||
|
))
|
||||||
|
->addSubcommand('components', array(
|
||||||
|
'help' => 'Update components to extend Component class.',
|
||||||
|
'parser' => $subcommandParser
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue