Merge pull request #141 from luisarmando/componentsUpgrade

Update component task, make components extend Component instead of Object
This commit is contained in:
José Lorenzo Rodríguez 2011-07-02 13:05:43 -07:00
commit f671be60d1

View file

@ -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
)); ));
} }
} }