Updating tasks to not rely on the dispatcher being available.

This commit is contained in:
mark_story 2010-10-24 15:27:44 -04:00
parent c169de60e2
commit 0a022f1d81
3 changed files with 9 additions and 4 deletions

View file

@ -192,7 +192,10 @@ class ExtractTask extends Shell {
return $parser->description(__('CakePHP Language String Extraction:'))
->addOption('app', array('help' => __('directory where your application is located.')))
->addOption('paths', array('help' => __('comma separted list of paths, full paths are needed.')))
->addOption('merge', array('help' => __('[yes|no] Merge all domain strings into the default.po file.')))
->addOption('merge', array(
'help' => __('[yes|no] Merge all domain strings into the default.po file.'),
'choices' => array('yes', 'no')
))
->addOption('output', array('help' => __('Full path to output directory.')))
->addOption('files', array('help' => __('comma separated list of files, full paths are needed.')));
}

View file

@ -54,8 +54,8 @@ class FixtureTask extends BakeTask {
* Override initialize
*
*/
public function __construct(&$dispatch, $stdout = null, $stderr = null, $stdin = null) {
parent::__construct($dispatch, $stdout, $stderr, $stdin);
public function __construct($stdout = null, $stderr = null, $stdin = null) {
parent::__construct($stdout, $stderr, $stdin);
$this->path = APP_PATH . 'tests' . DS . 'fixtures' . DS;
}

View file

@ -17,6 +17,8 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Folder');
class TemplateTask extends Shell {
/**
@ -179,7 +181,7 @@ class TemplateTask extends Shell {
}
$index = $this->in(__('Which bake theme would you like to use?'), range(1, $i - 1), 1);
$themeNames = array_keys($this->templatePaths);
$this->Dispatch->params['theme'] = $themeNames[$index - 1];
$this->params['theme'] = $themeNames[$index - 1];
return $indexedPaths[$index];
}