當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。