コード例 #1
0
ファイル: CLI.php プロジェクト: phalconslayer/framework
 /**
  * Handles the brood default options/arguments.
  */
 public static final function ArgvInput()
 {
     # get the raw commands
     $raws = ['--env', '--timeout'];
     # get the options from Brood
     $options = [Brood::environmentOption(), Brood::timeoutOption()];
     $instances = [];
     $reflect = new ReflectionClass(InputOption::class);
     foreach ($options as $opt) {
         $instances[] = $reflect->newInstanceArgs($opt);
     }
     # still, listen to the php $_SERVER['argv']
     $cmd_input = new ArgvInput();
     # get the default brood options
     $brood_input = new ArgvInput($raws, new InputDefinition($instances));
     foreach ($raws as $raw) {
         if ($cmd_input->hasParameterOption([$raw])) {
             $val = $cmd_input->getParameterOption($raw);
             $val = is_numeric($val) ? (int) $val : $val;
             $brood_input->setOption(str_replace('-', '', $raw), $val);
         }
     }
     return $brood_input;
 }
コード例 #2
0
ファイル: RouteCommand.php プロジェクト: ps-clarity/console
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     $this->app = new Filesystem(new LeagueFlysystemAdapterLocal(config()->path->app, 0));
     parent::__construct();
 }