コード例 #1
0
 public function execute(Context $context)
 {
     while (true) {
         $current_command = $context->getCurrentCommand();
         if (is_null($current_command)) {
             throw new RuntimeException('"end" not found ');
         } elseif ($current_command === 'end') {
             break;
         } else {
             $command = new CommandCommand();
             $command->execute($context);
         }
         $context->next();
     }
 }
コード例 #2
0
ファイル: Command.php プロジェクト: joegreen0991/command
 private function hasSttyAvailable()
 {
     if (null !== self::$stty) {
         return self::$stty;
     }
     exec('stty 2>&1', $output, $exitcode);
     return self::$stty = $exitcode === 0;
 }