Fix #1242 : Commands description check, move generate:template command to developer console

This commit is contained in:
Romain Neutron
2013-07-17 20:14:23 +02:00
parent 6d30f9bc9d
commit 899549d45a
41 changed files with 47 additions and 39 deletions

View File

@@ -62,8 +62,8 @@ try {
$cli->command(new \module_console_aboutAuthors('about:authors'));
$cli->command(new \module_console_aboutLicense('about:license'));
$cli->command(new \module_console_checkExtension('check:extension'));
$cli->command(new CheckConfig('check:config'));
$cli->command(new \module_console_checkExtension('check:extension'));
$cli->command(new UpgradeDBDatas('system:upgrade-datas'));
@@ -72,7 +72,6 @@ try {
$cli->command(new \module_console_systemMailCheck('system:mail-check'));
$cli->command(new \module_console_systemBackupDB('system:backup-db'));
$cli->command(new \module_console_systemClearCache('system:clear-cache'));
$cli->command(new \module_console_systemTemplateGenerator('system:template-generator'));
$cli->command(new \module_console_systemExport('system:export'));
$cli->command(new \module_console_taskrun('task:run'));
@@ -82,7 +81,7 @@ try {
$cli->command(new \module_console_schedulerStop('scheduler:stop'));
$cli->command(new \module_console_schedulerStart('scheduler:start'));
$cli->command(new Mailtest('mail:test'));
$cli->command(new MailTest('mail:test'));
$cli->command(new \module_console_fieldsList('fields:list'));
$cli->command(new \module_console_fieldsDelete('fields:delete'));

View File

@@ -78,6 +78,7 @@ try {
$cli->command(new Behat());
$cli->command(new LessCompiler());
$cli->command(new JavascriptBuilder());
$cli->command(new \module_console_systemTemplateGenerator('system:generate-templates'));
$cli['console']->addCommands(array(
// DBAL Commands

View File

@@ -31,7 +31,7 @@ class BuildMissingSubdefs extends Command
{
parent::__construct($name);
$this->setDescription('Build missing subviews');
$this->setDescription('Builds subviews that previously failed to be generated / did not exist when records were added');
return $this;
}

View File

@@ -33,7 +33,7 @@ class CheckConfig extends AbstractCheckCommand
{
parent::__construct($name);
$this->setDescription("Checks environment");
$this->setDescription("Performs a check against the environment and configuration. Give some advices for production settings.");
return $this;
}

View File

@@ -20,7 +20,7 @@ class Configuration extends Command
public function __construct()
{
parent::__construct('compile:configuration');
$this->setDescription('Compile configuration');
$this->setDescription('Compiles YAML configuration to plain PHP');
}
protected function doExecute(InputInterface $input, OutputInterface $output)

View File

@@ -33,7 +33,7 @@ class CreateCollection extends Command
{
parent::__construct($name);
$this->setDescription('Create a collection in Phraseanet')
$this->setDescription('Creates a collection in Phraseanet')
->setHelp('')
->addArgument('databox_id', InputArgument::REQUIRED, 'The id of the databox where to create the collection', null)
->addArgument('collname', InputArgument::REQUIRED, 'The name of the new collection', null)

View File

@@ -19,6 +19,8 @@ class APIRoutesDumper extends AbstractRoutesDumper
public function __construct()
{
parent::__construct('routes:dump-api');
$this->setDescription('Dumps Phraseanet API routes');
}
protected function doExecute(InputInterface $input, OutputInterface $output)

View File

@@ -21,6 +21,8 @@ class Behat extends Command
public function __construct()
{
parent::__construct('behat:help');
$this->setDescription('Prints helps about Phraseanet configuration for behat tests');
}
protected function doExecute(InputInterface $input, OutputInterface $output)

View File

@@ -26,7 +26,7 @@ class BowerInstall extends Command
parent::__construct('dependencies:bower');
$this
->setDescription('Install bower dependencies')
->setDescription('Installs bower dependencies')
->addOption('no-dev', 'd', InputOption::VALUE_NONE, 'Do not install dev dependencies')
->addOption('attempts', 'a', InputOption::VALUE_REQUIRED, 'Number of attempts to install dependencies.', 4);
}

View File

@@ -25,7 +25,7 @@ class ComposerInstall extends Command
parent::__construct('dependencies:composer');
$this
->setDescription('Install composer dependencies')
->setDescription('Installs composer dependencies')
->addOption('no-dev', 'd', InputOption::VALUE_NONE, 'Do not install dev dependencies')
->addOption('prefer-source', 'p', InputOption::VALUE_NONE, 'Use the --prefer-source composer option');
}

View File

@@ -23,7 +23,7 @@ class InstallAll extends Command
parent::__construct('dependencies:all');
$this
->setDescription('Install all dependencies')
->setDescription('Installs all dependencies')
->addOption('no-dev', 'd', InputOption::VALUE_NONE, 'Do not install dev dependencies')
->addOption('prefer-source', 'p', InputOption::VALUE_NONE, 'Use the --prefer-source composer option')
->addOption('attempts', 'a', InputOption::VALUE_REQUIRED, 'Number of attempts to install bower dependencies.', 4);

View File

@@ -26,7 +26,7 @@ class JavascriptBuilder extends Command
{
parent::__construct('assets:build-javascript');
$this->setDescription('Compile less files');
$this->setDescription('Builds Phraseanet JavaScript files');
}
/**

View File

@@ -24,7 +24,7 @@ class LessCompiler extends Command
{
parent::__construct('assets:compile-less');
$this->setDescription('Compile less files');
$this->setDescription('Compiles Phraseanet LESS files');
}
/**

View File

@@ -16,7 +16,7 @@ class RegenerateSqliteDb extends Command
{
parent::__construct('phraseanet:regenerate-sqlite');
$this->setDescription("Update the sqlite 'tests/db-ref.sqlite' database with current database definition.");
$this->setDescription("Updates the sqlite 'tests/db-ref.sqlite' database with current database definition.");
}
public function doExecute(InputInterface $input, OutputInterface $output)

View File

@@ -19,6 +19,8 @@ class RoutesDumper extends AbstractRoutesDumper
public function __construct()
{
parent::__construct('routes:dump');
$this->setDescription('Dumps Phraseanet routes');
}
protected function doExecute(InputInterface $input, OutputInterface $output)

View File

@@ -23,7 +23,9 @@ class MailTest extends Command
{
parent::__construct($name);
$this->addArgument('email', InputArgument::REQUIRED, 'An email where to send the test email');
$this
->setDescription('Sends an email to a given address to test mail-server configuration')
->addArgument('email', InputArgument::REQUIRED, 'An email where to send the test email');
}
protected function doExecute(InputInterface $input, OutputInterface $output)

View File

@@ -37,7 +37,7 @@ class RecordAdd extends Command
{
parent::__construct($name);
$this->setDescription('Add a record to Phraseanet')
$this->setDescription('Adds a record to Phraseanet')
->setHelp('')
->addArgument('base_id', InputArgument::REQUIRED, 'The target collection id', null)
->addArgument('file', InputArgument::REQUIRED, 'The file to archive', null)

View File

@@ -38,7 +38,7 @@ class RescanTechnicalDatas extends Command
{
parent::__construct($name);
$this->setDescription('Rescan databases for technical datas');
$this->setDescription('Rescans records for technical datas');
$this->setHelp('Old Phraseanet version did not fully read technical datas. This command rescan all records of these datas.');
return $this;

View File

@@ -31,7 +31,7 @@ class CheckEnvironment extends AbstractCheckCommand
{
parent::__construct($name);
$this->setDescription("Check environment");
$this->setDescription("Performs a check against the environment");
return $this;
}

View File

@@ -30,7 +30,7 @@ class Install extends Command
$this->executableFinder = new ExecutableFinder();
$this
->setDescription("Install Phraseanet")
->setDescription("Installs Phraseanet")
->addOption('email', null, InputOption::VALUE_OPTIONAL, 'Admin e-mail address', null)
->addOption('password', null, InputOption::VALUE_OPTIONAL, 'Admin password', null)
->addOption('db-host', null, InputOption::VALUE_OPTIONAL, 'MySQL server host', 'localhost')

View File

@@ -32,7 +32,7 @@ class UpgradeDBDatas extends Command
parent::__construct($name);
$this
->setDescription("Upgrade Phraseanet datas")
->setDescription("Upgrades Phraseanet datas, useful after migrations")
->setHelp(<<<EOF
Upgrade Phraseanet datas from older version

View File

@@ -26,7 +26,7 @@ class module_console_aboutAuthors extends Command
{
parent::__construct($name);
$this->setDescription('List authors and contributors');
$this->setDescription('Lists authors and contributors');
return $this;
}

View File

@@ -26,7 +26,7 @@ class module_console_aboutLicense extends Command
{
parent::__construct($name);
$this->setDescription('This program license');
$this->setDescription('Displays this program license');
return $this;
}

View File

@@ -29,7 +29,7 @@ class module_console_checkExtension extends Command
{
parent::__construct($name);
$this->setDescription('Checks if the Phrasea PHP Extension is well installed & working properly.');
$this->setDescription('Performs a serie of tests against Phrasea Engine PHP Extension');
$this->addArgument('usr_id', InputOption::VALUE_REQUIRED, 'Usr_id to use.');

View File

@@ -27,7 +27,7 @@ class module_console_fieldsDelete extends Command
{
parent::__construct($name);
$this->setDescription('Delete a documentation field from a Databox');
$this->setDescription('Deletes a documentation field from a Databox');
$this->addArgument('meta_struct_id', InputArgument::REQUIRED, 'Metadata structure id destination');
$this->addArgument('sbas_id', InputArgument::REQUIRED, 'Databox sbas_id');

View File

@@ -26,7 +26,7 @@ class module_console_fieldsList extends Command
{
parent::__construct($name);
$this->setDescription('List all databoxes fields');
$this->setDescription('Lists all databoxes documentation fields');
return $this;
}

View File

@@ -28,7 +28,7 @@ class module_console_fieldsMerge extends Command
{
parent::__construct($name);
$this->setDescription('Merge databox structure fields');
$this->setDescription('Merges databox documentation fields');
$this->addArgument('sbas_id', InputArgument::REQUIRED, 'Databox sbas_id');
$this->addArgument('destination', InputArgument::REQUIRED, 'Metadata structure id destination');

View File

@@ -27,7 +27,7 @@ class module_console_fieldsRename extends Command
{
parent::__construct($name);
$this->setDescription('Rename a documentation field from a Databox');
$this->setDescription('Renames a documentation field from a Databox');
$this->addArgument('name', InputArgument::REQUIRED, 'The new name');
$this->addArgument('meta_struct_id', InputArgument::REQUIRED, 'Metadata structure id destination');

View File

@@ -29,7 +29,7 @@ class module_console_schedulerStart extends Command
{
parent::__construct($name);
$this->setDescription('Start the scheduler');
$this->setDescription('Starts Phraseanet scheduler');
return $this;
}

View File

@@ -36,7 +36,7 @@ class module_console_schedulerState extends Command
{
parent::__construct($name);
$this->setDescription('Get scheduler status');
$this->setDescription('Returns Phraseanet scheduler status');
$this->addOption(
'short'

View File

@@ -26,7 +26,7 @@ class module_console_schedulerStop extends Command
{
parent::__construct($name);
$this->setDescription('Stop the scheduler');
$this->setDescription('Stops Phraseanet scheduler');
return $this;
}

View File

@@ -28,7 +28,7 @@ class module_console_sphinxGenerateSuggestion extends Command
{
parent::__construct($name);
$this->setDescription('Generate suggestions for Sphinx Search Engine');
$this->setDescription('Generates suggestions for Sphinx Search Engine, useful for query auto-completion');
return $this;
}

View File

@@ -34,7 +34,7 @@ class module_console_systemBackupDB extends Command
);
$this
->setDescription('Backup Phraseanet Databases')
->setDescription('Backups Phraseanet Databases')
->addArgument('directory', null, 'The directory where to backup', $dir)
->addOption('timeout', 't', InputOption::VALUE_REQUIRED, 'The timeout for this command (default is 3600s / 1h). Set 0 to disable timeout.', 3600)
->addOption('gzip', 'g', null, 'Gzip the output (requires gzip utility)')

View File

@@ -27,7 +27,7 @@ class module_console_systemClearCache extends Command
{
parent::__construct($name);
$this->setDescription('Empty cache directories, clear Memcached, Redis if avalaible');
$this->setDescription('Empties cache directories and cache-server data');
return $this;
}

View File

@@ -27,7 +27,7 @@ class module_console_systemExport extends Command
{
parent::__construct($name);
$this->setDescription('Export all phraseanet records to a directory');
$this->setDescription('Exports all phraseanet records to a given directory');
/**
* To implement

View File

@@ -27,7 +27,7 @@ class module_console_systemMailCheck extends Command
{
parent::__construct($name);
$this->setDescription('Check if email addresses are unique (mandatory since 3.5)');
$this->setDescription('Checks if email addresses are uniques (mandatory since 3.5)');
$this->addOption('list'
, 'l'
, null

View File

@@ -28,7 +28,7 @@ class module_console_systemTemplateGenerator extends Command
{
parent::__construct($name);
$this->setDescription('Generate template files');
$this->setDescription('Generates Twig templates files');
return $this;
}

View File

@@ -29,7 +29,7 @@ class module_console_systemUpgrade extends Command
parent::__construct($name);
$this
->setDescription('Upgrade Phraseanet to the latest version')
->setDescription('Upgrades Phraseanet to the latest version')
->addOption('yes', 'y', InputOption::VALUE_NONE, 'Answers yes to all questions and do not ask the user')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces the upgrade even if there is a concurrent upgrade')
->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps SQL queries that can be used to clean database.');

View File

@@ -45,7 +45,7 @@ class module_console_taskState extends Command
$this->addArgument('task_id', InputArgument::REQUIRED, 'The task_id to test');
$this->setDescription('Get task state');
$this->setDescription('Returns a Phraseanet task state given its id');
$this->addOption(
'short'

View File

@@ -27,7 +27,7 @@ class module_console_tasklist extends Command
{
parent::__construct($name);
$this->setDescription('List tasks');
$this->setDescription('Lists Phraseanet tasks');
return $this;
}

View File

@@ -53,7 +53,7 @@ class module_console_taskrun extends Command
'threshold : (DEBUG|INFO|WARNING|ERROR|CRITICAL|ALERT)',
''
)
->setDescription('Run task');
->setDescription('Runs a Phraseanet task given its id');
return $this;
}