getInput() public method

Gets the Process input.
public getInput ( ) : resource | string | Iterator | null
return resource | string | Iterator | null The Process input
コード例 #1
0
 public function __construct(Process $process)
 {
     if ($process->isSuccessful()) {
         throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
     }
     $error = sprintf('The command "%s" failed.', $process->getInput());
     if (!$process->isOutputDisabled()) {
         $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput());
     }
     parent::__construct($error);
     $this->process = $process;
 }
コード例 #2
0
ファイル: Manager.php プロジェクト: BobrD/ProcessManager
 /**
  * @param Process $process
  */
 public function runProcess(Process $process)
 {
     $commandLine = $process->getCommandLine();
     $cwd = $process->getWorkingDirectory();
     $input = $process->getInput();
     try {
         $process->start();
         $this->runningProcess[spl_object_hash($process)] = $process;
         $this->logger->info(sprintf('Запустили процес (cmd %s, cwd %s, input %s)', $commandLine, $cwd, $input));
         $this->runningProcess[spl_object_hash($process)] = $process;
     } catch (RuntimeException $e) {
         $this->logger->critical(sprintf('Неудалось отсновить процес (cmd %s, cwd %s, input %s)', $commandLine, $cwd, $input));
     }
 }