本文整理汇总了PHP中Shell::getOptionParser方法的典型用法代码示例。如果您正苦于以下问题:PHP Shell::getOptionParser方法的具体用法?PHP Shell::getOptionParser怎么用?PHP Shell::getOptionParser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell::getOptionParser方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptionParser
/**
* Add sub-commands.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->addSubcommand('core', array('help' => 'Delete all cache within CakePHP', 'parser' => array('description' => 'This command will clear all cache in CakePHP using the Cache engine settings.', 'options' => array('config' => array('short' => 'c', 'help' => 'Cache Config', 'default' => 'default'), 'key' => array('short' => 'k', 'help' => 'Cache Key', 'default' => '')))));
$parser->addSubcommand('apc', array('help' => 'Delete all cache within APC', 'parser' => array('description' => 'This command will clear all cache in APC, including user, system and opcode caches.')));
return $parser;
}
示例2: getOptionParser
/**
* getOptionParser
*
* @return Parser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->addSubcommand('generate', array('help' => '<model> <version> Generate a new image version', 'boolean' => true));
$parser->addSubcommand('remove', array('help' => '<model> <version> Remove an image version', 'boolean' => true));
$parser->addOption('storageModel', array('short' => 's', 'help' => __('The storage model for image processing you want to use.')));
$parser->addOption('limit', array('short' => 'l', 'help' => __('Limits the amount of records to be processed in one batch')));
return $parser;
}
示例3: getOptionParser
/**
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->addOptions(array('no-colors' => array('help' => __('Do not use colors in output.'), 'boolean' => true)));
if (!empty($this->locked_commands)) {
$parser->addOption('skip-lock', array('short' => 's', 'help' => __('Forces the command to run even if locked.'), 'boolean' => true));
}
return $parser;
}
示例4: getOptionParser
public function getOptionParser($task = false)
{
$this->stdout->styles('option', array('bold' => true));
$parser = parent::getOptionParser();
$options = array('path' => array('short' => 'p', 'default' => 'APP', 'help' => 'comma-delimited path list (constants or strings)'), 'exclude' => array('short' => 'e', 'default' => NULL, 'help' => 'comma-delimited path exclusion list (constants or strings)'), 'mode' => array('short' => 'm', 'default' => 'interactive', 'choices' => array('interactive', 'diff', 'silent'), 'help' => "<option>interactive</option> shows errors individually and prompts for change\n" . "<option>diff</option> writes a unified diff to current directory without changing files\n" . "<option>silent</option> corrects all errors without prompting\n"), 'files' => array('short' => 'f', 'default' => 'php', 'help' => 'comma-delimited extension list, defaults to php'));
$parser->addOptions($options);
$parser->description('<info>Ensure code is error-free and follows conventions</info>');
return $parser;
}
示例5: getOptionParser
/**
* {@inheritdoc}
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->description('There is no help');
$taskNames = array_keys(Hash::normalize($this->tasks));
foreach ($taskNames as $taskName) {
$Task = $this->{$taskName};
$parser->addSubcommand(Inflector::underscore($Task->name), array('help' => $Task->getOptionParser()->description(), 'parser' => $Task->getOptionParser()));
}
return $parser;
}
示例6: getOptionParser
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->description('Spec for PHP ' . DrSlump\Spec::VERSION . ' by Ivan -DrSlump- Montes');
$parser->addOption('color', array('help' => __('turn on colored output [yes, no, *auto]'), 'choices' => array('auto', 'yes', 'no'), 'default' => 'auto'));
$parser->addOption('debug', array('help' => 'turn on debug output', 'boolean' => true));
$parser->addOption('filter', array('short' => 'f', 'help' => 'filter which tests to run (regexp)', 'default' => array()));
$parser->addOption('groups', array('short' => 'g', 'help' => 'run only this group (csv)', 'default' => array()));
$parser->addOption('exclude_groups', array('help' => 'do not run this group (csv)', 'default' => array()));
$parser->addOption('list_groups', array('help' => 'show available groups', 'boolean' => true));
$parser->addOption('story', array('short' => 's', 'help' => 'turn on story style formatting', 'boolean' => true));
$parser->addOption('format', array('help' => 'output format [*dots, story]', 'choices' => array('dots', 'story'), 'default' => 'dots'));
$parser->addOption('beep', array('short' => 'b', 'help' => 'turn on beep on failure', 'boolean' => true));
$parser->addOption('dump', array('short' => 'd', 'help' => 'dump a spec file transformed to PHP', 'boolean' => true));
$parser->addArgument('file', array('help' => 'spec file'));
return $parser;
}
示例7: getOptionParser
/**
* get the option parser.
*
* @return void
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description('The Migration shell.' . '')->addOption('plugin', array('short' => 'p', 'help' => __('Plugin name to be used')))->addOption('force', array('short' => 'f', 'help' => __('Force \'generate\' to compare all tables.')))->addOption('connection', array('short' => 'c', 'default' => 'default', 'help' => __('Set db config <config>. Uses \'default\' if none is specified.')))->addSubcommand('status', array('help' => __('Displays a status of all plugin and app migrations.')))->addSubcommand('all', array('help' => __('Bake a complete MVC. optional <name> of a Model')))->addSubcommand('run', array('help' => __('Run a migration to given direction or version.')))->addSubcommand('generate', array('help' => __('Generates a migration file.')))->addSubcommand('add', array('help' => __('Generates a migration file.')));
/*
The Migration database management for CakePHP
---------------------------------------------------------------
Usage: cake migration <command> <param1> <param2>...
---------------------------------------------------------------
Params:
-connection <config>
Set db config <config>. Uses 'default' if none is specified.
-plugin
Plugin name to be used
-f
Force 'generate' to compare all tables.
Commands:
migration help
Shows this help message.
migration run <up|down|all|reset|version>
Run a migration to given direction or version.
Provide a version number to get directly to the version.
You can also use all to apply all migrations or reset to unapply all.
migration <generate|add>
Generates a migration file.
To force generation of all tables when making a comparison/dump, use the -f param.
migration status <outdated>
Displays a status of all plugin and app migrations.
*/
}
示例8: getOptionParser
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->description(__('Generates hydrator classes for document classes.'))->addOption('filter', array('short' => 'f', 'default' => null, 'help' => __('A string pattern used to match documents that should be processed.')))->addOption('destPath', array('short' => 'd', 'default' => null, 'help' => __('The path to generate your hydrator classes. Default taken from configuration.')));
return $parser;
}
示例9: getOptionParser
/**
* Get and configure the optionparser.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->addArgument('type', array('help' => __d('cake_console', 'Either a full path or type of class (model, behavior, controller, component, view, helper)')))->addArgument('className', array('help' => __d('cake_console', 'A CakePHP core class name (e.g: Component, HtmlHelper).')))->addOption('method', array('short' => 'm', '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;
}
示例10: getOptionParser
/**
* get the option parser.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description(__('Generate a new CakePHP project skeleton.'))->addArgument('name', array('help' => __('Application directory to make, if it starts with "/" the path is absolute.')))->addOption('empty', array('help' => __('Create empty files in each of the directories. Good if you are using git')))->addOption('skel', array('help' => __('The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')));
}
示例11: getOptionParser
public function getOptionParser()
{
return parent::getOptionParser()->description(__("Better manage, and easily synchronize you application's ACO tree"))->addSubcommand('aco_update', array('help' => __('Add new ACOs for new controllers and actions. Does not remove nodes from the ACO table.')))->addSubcommand('aco_sync', array('help' => __('Perform a full sync on the ACO table.' . 'Will create new ACOs or missing controllers and actions.' . 'Will also remove orphaned entries that no longer have a matching controller/action')))->addSubcommand('verify', array('help' => __('Verify the tree structure of either your Aco or Aro Trees'), 'parser' => array('arguments' => array('type' => array('required' => true, 'help' => __('The type of tree to verify'), 'choices' => array('aco', 'aro'))))))->addSubcommand('recover', array('help' => __('Recover a corrupted Tree'), 'parser' => array('arguments' => array('type' => array('required' => true, 'help' => __('The type of tree to recover'), 'choices' => array('aco', 'aro'))))));
}
示例12: getOptionParser
/**
* get the option parser
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$subcommandParser = array(
'options' => array(
'plugin' => array(
'short' => 'p',
'help' => __d('cake_console', 'The plugin to update. Only the specified plugin will be updated.')
),
'ext' => array(
'short' => 'e',
'help' => __d('cake_console', 'The extension(s) to search. A pipe delimited list, or a preg_match compatible subpattern'),
'default' => 'php|ctp|thtml|inc|tpl'
),
'git' => array(
'short' => 'g',
'help' => __d('cake_console', 'Use git command for moving files around.'),
'boolean' => true
),
'dry-run'=> array(
'short' => 'd',
'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'),
'boolean' => true
)
)
);
return parent::getOptionParser()
->description(__d('cake_console', "A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" .
"Be sure to have a backup of your application before running these commands."))
->addSubcommand('all', array(
'help' => __d('cake_console', 'Run all upgrade commands.'),
'parser' => $subcommandParser
))
->addSubcommand('tests', array(
'help' => __d('cake_console', 'Update tests class names to FooTest rather than FooTestCase.'),
'parser' => $subcommandParser
))
->addSubcommand('locations', array(
'help' => __d('cake_console', 'Move files and folders to their new homes.'),
'parser' => $subcommandParser
))
->addSubcommand('i18n', array(
'help' => __d('cake_console', 'Update the i18n translation method calls.'),
'parser' => $subcommandParser
))
->addSubcommand('helpers', array(
'help' => __d('cake_console', 'Update calls to helpers.'),
'parser' => $subcommandParser
))
->addSubcommand('basics', array(
'help' => __d('cake_console', 'Update removed basics functions to PHP native functions.'),
'parser' => $subcommandParser
))
->addSubcommand('request', array(
'help' => __d('cake_console', 'Update removed request access, and replace with $this->request.'),
'parser' => $subcommandParser
))
->addSubcommand('configure', array(
'help' => __d('cake_console', "Update Configure::read() to Configure::read('debug')"),
'parser' => $subcommandParser
))
->addSubcommand('constants', array(
'help' => __d('cake_console', "Replace Obsolete constants"),
'parser' => $subcommandParser
))
->addSubcommand('components', array(
'help' => __d('cake_console', 'Update components to extend Component class.'),
'parser' => $subcommandParser
));
}
示例13: getOptionParser
/**
* get the option parser
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console', 'Bake new database configuration settings.'));
}
示例14: getOptionParser
/**
* get the option parser.
*
* @return void
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description('The Auditable shell.' . '')->addOption('connection', array('short' => 'c', 'default' => 'default', 'help' => __d('Auditable', 'Set db config <config>. Uses \'default\' if none is specified.')))->addOption('force', array('short' => 'f', 'boolean' => true, 'help' => __d('Auditable', 'Force changes in all tables of database.')))->addSubcommand('insert', array('help' => __d('Auditable', 'Insert columns \'created_by\' and \'modified_by\' in all database tables.')))->addSubcommand('remove', array('help' => __d('Auditable', 'Remove columns \'created_by\' and \'modified_by\' from all database tables.')));
}
示例15: getOptionParser
/**
* Get & configure the option parser
*
* @return void
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console', 'CakePHP Language String Extraction:'))->addOption('app', array('help' => __d('cake_console', 'Directory where your application is located.')))->addOption('paths', array('help' => __d('cake_console', 'Comma separated list of paths.')))->addOption('merge', array('help' => __d('cake_console', 'Merge all domain strings into the default.po file.'), 'choices' => array('yes', 'no')))->addOption('output', array('help' => __d('cake_console', 'Full path to output directory.')))->addOption('files', array('help' => __d('cake_console', 'Comma separated list of files.')))->addOption('exclude-plugins', array('boolean' => true, 'default' => true, 'help' => __d('cake_console', 'Ignores all files in plugins if this command is run inside from the same app directory.')))->addOption('plugin', array('help' => __d('cake_console', 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.')))->addOption('ignore-model-validation', array('boolean' => true, 'default' => false, 'help' => __d('cake_console', 'Ignores validation messages in the $validate property. If this flag is not set and the command is run from the same app directory, all messages in model validation rules will be extracted as tokens.')))->addOption('validation-domain', array('help' => __d('cake_console', 'If set to a value, the localization domain to be used for model validation messages.')))->addOption('exclude', array('help' => __d('cake_console', 'Comma separated list of directories to exclude. Any path containing a path segment with the provided values will be skipped. E.g. test,vendors')));
}