think\Process::disableOutput PHP Méthode

disableOutput() public méthode

禁用从底层过程获取输出和错误输出。
public disableOutput ( ) : Process
Résultat Process
    public function disableOutput()
    {
        if ($this->isRunning()) {
            throw new \RuntimeException('Disabling output while the process is running is not possible.');
        }
        if (null !== $this->idleTimeout) {
            throw new \LogicException('Output can not be disabled while an idle timeout is set.');
        }
        $this->outputDisabled = true;
        return $this;
    }

Usage Example

Exemple #1
0
 /**
  * 创建一个Process实例
  * @return Process
  */
 public function getProcess()
 {
     if (0 === count($this->prefix) && 0 === count($this->arguments)) {
         throw new \LogicException('You must add() command arguments before calling getProcess().');
     }
     $options = $this->options;
     $arguments = array_merge($this->prefix, $this->arguments);
     $script = implode(' ', array_map([__NAMESPACE__ . '\\Utils', 'escapeArgument'], $arguments));
     if ($this->inheritEnv) {
         // include $_ENV for BC purposes
         $env = array_replace($_ENV, $_SERVER, $this->env);
     } else {
         $env = $this->env;
     }
     $process = new Process($script, $this->cwd, $env, $this->input, $this->timeout, $options);
     if ($this->outputDisabled) {
         $process->disableOutput();
     }
     return $process;
 }