getArgument() public method

根据名称获取参数
public getArgument ( string $name ) : mixed
$name string 参数名
return mixed
示例#1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(Input $input, Output $output)
 {
     if (null === $this->command) {
         $this->command = $this->getConsole()->find($input->getArgument('command_name'));
     }
     $output->describe($this->command, ['raw_text' => $input->getOption('raw')]);
     $this->command = null;
 }
示例#2
0
 protected function execute(Input $input, Output $output)
 {
     if ($input->hasArgument('module')) {
         $module = $input->getArgument('module') . DS;
     } else {
         $module = '';
     }
     $content = '<?php ' . PHP_EOL . $this->buildCacheContent($module);
     if (!is_dir(RUNTIME_PATH . $module)) {
         @mkdir(RUNTIME_PATH . $module, 0755, true);
     }
     file_put_contents(RUNTIME_PATH . $module . 'init' . EXT, $content);
     $output->writeln('<info>Succeed!</info>');
 }
示例#3
0
 protected function execute(Input $input, Output $output)
 {
     $name = trim($input->getArgument('name'));
     $classname = $this->getClassName($name);
     $pathname = $this->getPathName($classname);
     if (is_file($pathname)) {
         $output->writeln('<error>' . $this->type . ' already exists!</error>');
         return false;
     }
     if (!is_dir(dirname($pathname))) {
         mkdir(strtolower(dirname($pathname)), 0755, true);
     }
     file_put_contents($pathname, $this->buildClass($classname));
     $output->writeln('<info>' . $this->type . ' created successfully.</info>');
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 protected function execute(Input $input, Output $output)
 {
     $output->describe($this->getConsole(), ['raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace')]);
 }
示例#5
0
文件: Lists.php 项目: Lofanmi/think
 /**
  * {@inheritdoc}
  */
 protected function execute(Input $input, Output $output)
 {
     $helper = new DescriptorHelper();
     $helper->describe($output, $this->getConsole(), ['raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace')]);
 }