当前位置: 首页>>代码示例>>PHP>>正文


PHP Command::setName方法代码示例

本文整理汇总了PHP中Symfony\Component\Console\Command\Command::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::setName方法的具体用法?PHP Command::setName怎么用?PHP Command::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Console\Command\Command的用法示例。


在下文中一共展示了Command::setName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setName

 /**
  * @param string $name
  * @return AbstractCommand
  */
 public function setName($name)
 {
     if (!$this->getName()) {
         return parent::setName($name);
     }
     return $this;
 }
开发者ID:lulco,项目名称:phoenix,代码行数:11,代码来源:AbstractCommand.php

示例2: add

 public function add(Command $command, $namespace = '')
 {
     if (strlen($namespace)) {
         $command->setName($namespace . ':' . $command->getName());
     }
     $this->app->add($command);
 }
开发者ID:maslosoft,项目名称:sitcom,代码行数:7,代码来源:CommandWrapper.php

示例3: __construct

 public function __construct(Command $singleCommand)
 {
     global $argv;
     $this->singleCommand = $singleCommand;
     // Use the command's name as the whole app's name
     $this->setName($singleCommand->getName());
     // Then set the command's name to be the name of the script file
     //  executed (as executed, regardless of symlinks, etc) - i.e.
     //  whatever's set as $argv[0] - because this name ends up displayed in
     //  the "Usage" line of the `--help` output. Though we use the executed
     //  script's base name (i.e. none of the directories leading to it)
     //  because including any parts of the directory path results in a
     //  `--help` output that's very different to all native/standard
     //  commands.
     // This will result in the "Usage" section displaying as:
     //     my-command.php [options] [--] <arguments>
     //  instead of showing the name of the command in place of
     //  'my-command.php', which is especially useful for single-command
     //  apps, as the command name is never even referenced anywhere else!
     $commandName = isset($argv[0]) ? basename($argv[0]) : 'command.php';
     $singleCommand->setName($commandName);
     parent::__construct();
     $this->add($singleCommand);
     $this->setDefaultCommand($singleCommand->getName());
     // If the command class has an 'APP_VERSION' constant defined, we use
     //  that as the entire app's version, as this seems like a much more
     //  sensible place to indicate the version than in the Application
     //  constructor which is tucked away in a non-obvious place!
     $commandClass = get_class($singleCommand);
     if (defined($commandClass . '::APP_VERSION')) {
         $this->setVersion(constant($commandClass . '::APP_VERSION'));
     }
 }
开发者ID:aziraphale,项目名称:symfony-single-command-application,代码行数:33,代码来源:SingleCommandApplication.php

示例4: configureTransfer

 public static function configureTransfer(BaseCommand $command, $name = 'transfer', $output = true)
 {
     $command->setName($name)->setDescription('Clone all nodes and relations from one Neo4j Server database into another.');
     DumpCommand::configureSourceConnectionOptions($command);
     if ($output) {
         DumpCommand::configureOutputOptions($command);
     }
     ImportCommand::configureTargetConnectionOptions($command);
 }
开发者ID:liutec,项目名称:neo4jtransfer,代码行数:9,代码来源:TransferCommand.php

示例5: integrate

 public function integrate(Command $cmd)
 {
     $cmd->setName("metro:" . $cmd->getName());
     $definition = $cmd->getDefinition();
     $options = $definition->getOptions();
     if (isset($options['short'])) {
         // remove -s shortcut (already used by Symfony's --shell option)
         $shortOption = $options['short'];
         $options['short'] = new InputOption('short', null, InputOption::VALUE_NONE, $shortOption->getDescription());
         $definition->setOptions($options);
     }
 }
开发者ID:metro-q,项目名称:metro-bundle,代码行数:12,代码来源:CommandIntegrator.php

示例6: configureImport

 public static function configureImport(BaseCommand $command, $name = 'import')
 {
     $command->setName($name)->setDescription('Import all nodes and relations into a Neo4j Server database.');
     static::configureTargetConnectionOptions($command);
     $command->addOption('input', null, InputArgument::OPTIONAL, 'Cypher input filename. If unspecified, will use STDIN. Set to last:[hostname] to use dump-[hostname]-[yyyyMMdd]-[hhmmss].cypher with the latest timestamp.');
 }
开发者ID:liutec,项目名称:neo4jtransfer,代码行数:6,代码来源:ImportCommand.php

示例7: setName

 /**
  * {@inheritdoc}
  */
 public function setName($name)
 {
     $this->decoratedCommand->setName($name);
     return $this;
 }
开发者ID:frankdejonge,项目名称:locked-console-command,代码行数:8,代码来源:LockedCommandDecorator.php

示例8: configure

 /**
  * configure.
  *
  * @param Command $command
  */
 public static function configure(Command $command)
 {
     $command->setName('migrations:list')->setDescription('Prints version IDs for all available migrations ordered incrementally.')->addOption('newest-first', null, InputOption::VALUE_NONE, 'Sort list in reverse order (newest first)');
 }
开发者ID:baleen,项目名称:cli,代码行数:9,代码来源:ListMessage.php

示例9: configureDump

 public static function configureDump(BaseCommand $command, $name = 'dump')
 {
     $command->setName($name)->setDescription('Dump all nodes and relations from a Neo4j Server database.');
     static::configureSourceConnectionOptions($command);
     static::configureOutputOptions($command);
 }
开发者ID:liutec,项目名称:neo4jtransfer,代码行数:6,代码来源:DumpCommand.php

示例10: configure

 public function configure(Command $command)
 {
     $command->setName('task:purge-badge-page-props')->setDescription('Purge page props of pages to update badges')->addOption('chunk', null, InputOption::VALUE_OPTIONAL, 'The chunk size to fetch entities', 100);
 }
开发者ID:benestar,项目名称:benebot,代码行数:4,代码来源:PurgeBadgesPageProps.php

示例11: configure

 protected function configure()
 {
     parent::setName('generate:entity')->setDescription('Generates a Link entity from a table')->addArgument('entity', InputArgument::REQUIRED, 'The fully-qualified class name of the entity to ' . 'generate (use forward slashes instead of backslashes)')->addArgument('destination', InputArgument::OPTIONAL, 'The directory where the generated entity ' . 'should be saved', self::DEFAULT_PATH)->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite any existing files');
 }
开发者ID:LartTyler,项目名称:Link,代码行数:4,代码来源:GenerateEntityCommand.php

示例12: setName

 public function setName($name)
 {
     parent::setName($name);
     return $this->innerCommand->setName($name);
 }
开发者ID:lolautruche,项目名称:ezsh,代码行数:5,代码来源:WrappedCommand.php

示例13: configure

 /**
  * Configures a console command by setting name, description, arguments, etc.
  *
  * @param Command $command
  */
 public static function configure(Command $command)
 {
     $command->setName('config:status');
     $command->setAliases(['status']);
     $command->setDescription('Shows the current migration status.');
 }
开发者ID:baleen,项目名称:cli,代码行数:11,代码来源:StatusMessage.php

示例14: configure

 /**
  * @inheritdoc
  */
 public static function configure(Command $command)
 {
     $command->setName('storage:latest')->setDescription('Outputs the ID of the latest migrated version.');
 }
开发者ID:baleen,项目名称:cli,代码行数:7,代码来源:LatestMessage.php

示例15: configure

 public function configure(Command $command)
 {
     $command->setName('task:update-badges')->setDescription('Update badges based on Wikipedia categories on Wikidata')->addOption('badge', null, InputOption::VALUE_REQUIRED, 'The badge to set')->addOption('category', null, InputOption::VALUE_REQUIRED, 'The category to query')->addOption('bot', null, InputOption::VALUE_OPTIONAL, 'Mark edits as bot', true)->addOption('summary', null, InputOption::VALUE_OPTIONAL, 'Override the default edit summary', 'Bot: Adding badge [[$badgeId]] for site $wiki based on Category:$category');
 }
开发者ID:benestar,项目名称:benebot,代码行数:4,代码来源:UpdateBadges.php


注:本文中的Symfony\Component\Console\Command\Command::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。