Skip to content

Commit

Permalink
Update component task, make components extend Component instead of Ob…
Browse files Browse the repository at this point in the history
…ject.
  • Loading branch information
labianchin committed Jul 2, 2011
1 parent ee2930d commit ae9a3ef
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -421,6 +421,29 @@ public function constants() {
$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
*
Expand Down Expand Up @@ -636,6 +659,10 @@ public function getOptionParser() {
->addSubcommand('constants', array(
'help' => "Replace Obsolete constants",
'parser' => $subcommandParser
))
->addSubcommand('components', array(
'help' => 'Update components to extend Component class.',
'parser' => $subcommandParser
));
}
}

0 comments on commit ae9a3ef

Please sign in to comment.