mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding subcommand docs for i18n shell.
Adding execute checks to shell, this is a temporary fix that stops extra clears being done.
This commit is contained in:
parent
fe7c7a1b12
commit
3be24d0b0b
2 changed files with 5 additions and 3 deletions
|
@ -109,7 +109,9 @@ class I18nShell extends Shell {
|
|||
*/
|
||||
protected function _getOptionParser() {
|
||||
$parser = parent::_getOptionParser();
|
||||
return $parser->description(__('I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.'));
|
||||
return $parser->description(__('I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.'))
|
||||
->addSubcommand('initdb', array('help' => __('Initialize the i18n table.')))
|
||||
->addSubcommand('extract', array('help' => __('Extract the po translations from your application')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -320,14 +320,14 @@ class Shell extends Object {
|
|||
$isMethod = $this->hasMethod($command);
|
||||
$isMain = $this->hasMethod('main');
|
||||
|
||||
if ($isTask || $isMethod) {
|
||||
if ($isTask || $isMethod && $command !== 'execute') {
|
||||
array_shift($argv);
|
||||
}
|
||||
|
||||
$this->OptionParser = $this->_getOptionParser();
|
||||
list($this->params, $this->args) = $this->OptionParser->parse($argv);
|
||||
|
||||
if ($isTask || $isMethod || $isMain) {
|
||||
if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
|
||||
$this->startup();
|
||||
}
|
||||
if ($isTask) {
|
||||
|
|
Loading…
Reference in a new issue