Skip to content

Commit

Permalink
use the cake_console domain for everything related to the cli
Browse files Browse the repository at this point in the history
using big po files causes a lot of noise to be loaded whenver the
langauge domain is touched - therefore avoid any cli messages from being
loaded by web requests at all.
  • Loading branch information
AD7six committed Mar 19, 2011
1 parent d2badbe commit 2078dbc
Show file tree
Hide file tree
Showing 23 changed files with 442 additions and 442 deletions.
156 changes: 78 additions & 78 deletions lib/Cake/Console/Command/AclShell.php

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions lib/Cake/Console/Command/ApiShell.php
Expand Up @@ -85,15 +85,15 @@ public function main() {
}

} else {
$this->error(__d('cake', '%s not found', $class));
$this->error(__d('cake_console', '%s not found', $class));
}

$parsed = $this->__parseClass($path . $class .'.php', $class);

if (!empty($parsed)) {
if (isset($this->params['method'])) {
if (!isset($parsed[$this->params['method']])) {
$this->err(__d('cake', '%s::%s() could not be found', $class, $this->params['method']));
$this->err(__d('cake_console', '%s::%s() could not be found', $class, $this->params['method']));
$this->_stop();
}
$method = $parsed[$this->params['method']];
Expand All @@ -110,9 +110,9 @@ public function main() {
$this->out($list);

$methods = array_keys($parsed);
while ($number = strtolower($this->in(__d('cake', 'Select a number to see the more information about a specific method. q to quit. l to list.'), null, 'q'))) {
while ($number = strtolower($this->in(__d('cake_console', 'Select a number to see the more information about a specific method. q to quit. l to list.'), null, 'q'))) {
if ($number === 'q') {
$this->out(__d('cake', 'Done'));
$this->out(__d('cake_console', 'Done'));
return $this->_stop();
}

Expand Down Expand Up @@ -145,8 +145,8 @@ public function getOptionParser() {
'help' => 'A CakePHP core class name (e.g: Component, HtmlHelper).'
))->addOption('method', array(
'short' => 'm',
'help' => __d('cake', 'The specific method you want help on.')
))->description(__d('cake', 'Lookup doc block comments for classes in CakePHP.'));
'help' => __d('cake_console', 'The specific method you want help on.')
))->description(__d('cake_console', 'Lookup doc block comments for classes in CakePHP.'));
return $parser;
}
/**
Expand Down Expand Up @@ -199,7 +199,7 @@ function __parseClass($path, $class) {

if (!class_exists($class)) {
if (!include_once($path)) {
$this->err(__d('cake', '%s could not be found', $path));
$this->err(__d('cake_console', '%s could not be found', $path));
}
}

Expand Down
30 changes: 15 additions & 15 deletions lib/Cake/Console/Command/BakeShell.php
Expand Up @@ -75,7 +75,7 @@ public function main() {
}

if (!config('database')) {
$this->out(__d('cake', 'Your database configuration was not found. Take a moment to create one.'));
$this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.'));
$this->args = null;
return $this->DbConfig->execute();
}
Expand All @@ -90,7 +90,7 @@ public function main() {
$this->out('[T]est case');
$this->out('[Q]uit');

$classToBake = strtoupper($this->in(__d('cake', 'What would you like to Bake?'), array('D', 'M', 'V', 'C', 'P', 'F', 'T', 'Q')));
$classToBake = strtoupper($this->in(__d('cake_console', 'What would you like to Bake?'), array('D', 'M', 'V', 'C', 'P', 'F', 'T', 'Q')));
switch ($classToBake) {
case 'D':
$this->DbConfig->execute();
Expand All @@ -117,7 +117,7 @@ public function main() {
exit(0);
break;
default:
$this->out(__d('cake', 'You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, F, T, or C.'));
$this->out(__d('cake_console', 'You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, F, T, or C.'));
}
$this->hr();
$this->main();
Expand Down Expand Up @@ -182,10 +182,10 @@ public function all() {
$this->View->execute();
}
$this->out('', 1, Shell::QUIET);
$this->out(__d('cake', '<success>Bake All complete</success>'), 1, Shell::QUIET);
$this->out(__d('cake_console', '<success>Bake All complete</success>'), 1, Shell::QUIET);
array_shift($this->args);
} else {
$this->error(__d('cake', 'Bake All could not continue without a valid model'));
$this->error(__d('cake_console', 'Bake All could not continue without a valid model'));
}
return $this->_stop();
}
Expand All @@ -203,33 +203,33 @@ public function getOptionParser() {
'creation process. You can customize the generation process by telling Bake' .
'where different parts of your application are using command line arguments.'
)->addSubcommand('all', array(
'help' => __d('cake', 'Bake a complete MVC. optional <name> of a Model'),
'help' => __d('cake_console', 'Bake a complete MVC. optional <name> of a Model'),
))->addSubcommand('project', array(
'help' => __d('cake', 'Bake a new app folder in the path supplied or in current directory if no path is specified'),
'help' => __d('cake_console', 'Bake a new app folder in the path supplied or in current directory if no path is specified'),
'parser' => $this->Project->getOptionParser()
))->addSubcommand('plugin', array(
'help' => __d('cake', 'Bake a new plugin folder in the path supplied or in current directory if no path is specified.'),
'help' => __d('cake_console', 'Bake a new plugin folder in the path supplied or in current directory if no path is specified.'),
'parser' => $this->Plugin->getOptionParser()
))->addSubcommand('db_config', array(
'help' => __d('cake', 'Bake a database.php file in config directory.'),
'help' => __d('cake_console', 'Bake a database.php file in config directory.'),
'parser' => $this->DbConfig->getOptionParser()
))->addSubcommand('model', array(
'help' => __d('cake', 'Bake a model.'),
'help' => __d('cake_console', 'Bake a model.'),
'parser' => $this->Model->getOptionParser()
))->addSubcommand('view', array(
'help' => __d('cake', 'Bake views for controllers.'),
'help' => __d('cake_console', 'Bake views for controllers.'),
'parser' => $this->View->getOptionParser()
))->addSubcommand('controller', array(
'help' => __d('cake', 'Bake a controller.'),
'help' => __d('cake_console', 'Bake a controller.'),
'parser' => $this->Controller->getOptionParser()
))->addSubcommand('fixture', array(
'help' => __d('cake', 'Bake a fixture.'),
'help' => __d('cake_console', 'Bake a fixture.'),
'parser' => $this->Fixture->getOptionParser()
))->addSubcommand('test', array(
'help' => __d('cake', 'Bake a unit test.'),
'help' => __d('cake_console', 'Bake a unit test.'),
'parser' => $this->Test->getOptionParser()
))->addOption('connection', array(
'help' => __d('cake', 'Database connection to use in conjunction with `bake all`.'),
'help' => __d('cake_console', 'Database connection to use in conjunction with `bake all`.'),
'short' => 'c',
'default' => 'default'
));
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/Command/CommandListShell.php
Expand Up @@ -214,10 +214,10 @@ public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description('Get the list of available shells for this CakePHP application.')
->addOption('xml', array(
'help' => __d('cake', 'Get the listing as XML.'),
'help' => __d('cake_console', 'Get the listing as XML.'),
'boolean' => true
))->addOption('sort', array(
'help' => __d('cake', 'Sorts the commands by where they are located.'),
'help' => __d('cake_console', 'Sorts the commands by where they are located.'),
'boolean' => true
));
}
Expand Down
22 changes: 11 additions & 11 deletions lib/Cake/Console/Command/I18nShell.php
Expand Up @@ -52,7 +52,7 @@ public function startup() {

if ($this->command && !in_array($this->command, array('help'))) {
if (!config('database')) {
$this->out(__d('cake', 'Your database configuration was not found. Take a moment to create one.'), true);
$this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.'), true);
return $this->DbConfig->execute();
}
}
Expand All @@ -63,14 +63,14 @@ public function startup() {
*
*/
public function main() {
$this->out(__d('cake', '<info>I18n Shell</info>'));
$this->out(__d('cake_console', '<info>I18n Shell</info>'));
$this->hr();
$this->out(__d('cake', '[E]xtract POT file from sources'));
$this->out(__d('cake', '[I]nitialize i18n database table'));
$this->out(__d('cake', '[H]elp'));
$this->out(__d('cake', '[Q]uit'));
$this->out(__d('cake_console', '[E]xtract POT file from sources'));
$this->out(__d('cake_console', '[I]nitialize i18n database table'));
$this->out(__d('cake_console', '[H]elp'));
$this->out(__d('cake_console', '[Q]uit'));

$choice = strtolower($this->in(__d('cake', 'What would you like to do?'), array('E', 'I', 'H', 'Q')));
$choice = strtolower($this->in(__d('cake_console', 'What would you like to do?'), array('E', 'I', 'H', 'Q')));
switch ($choice) {
case 'e':
$this->Extract->execute();
Expand All @@ -85,7 +85,7 @@ public function main() {
exit(0);
break;
default:
$this->out(__d('cake', 'You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.'));
$this->out(__d('cake_console', 'You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.'));
}
$this->hr();
$this->main();
Expand All @@ -107,11 +107,11 @@ public function initdb() {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__d('cake', 'I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.')
__d('cake_console', 'I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.')
)->addSubcommand('initdb', array(
'help' => __d('cake', 'Initialize the i18n table.')
'help' => __d('cake_console', 'Initialize the i18n table.')
))->addSubcommand('extract', array(
'help' => __d('cake', 'Extract the po translations from your application'),
'help' => __d('cake_console', 'Extract the po translations from your application'),
'parser' => $this->Extract->getOptionParser()
));
}
Expand Down

0 comments on commit 2078dbc

Please sign in to comment.