PhpBrew\CommandBuilder::passthru PHP Méthode

passthru() public méthode

public passthru ( &$lastline = null )
    public function passthru(&$lastline = null)
    {
        $ret = null;
        $command = $this->buildCommand(false);
        $lastline = passthru($command, $ret);
        if ($lastline === false) {
            return $ret;
        }
        return $ret;
    }

Usage Example

Exemple #1
0
 public function install(Build $build)
 {
     $this->info('Installing...');
     if ($this->options->sudo) {
         $cmd = new CommandBuilder('sudo make install');
         if (!$this->options->dryrun) {
             $code = $cmd->passthru($lastline);
             if ($code !== 0) {
                 throw new SystemCommandException("Install failed: {$lastline}", $build, $build->getBuildLogPath());
             }
         }
     } else {
         $cmd = new CommandBuilder('make install');
         $cmd->setAppendLog(true);
         $cmd->setLogPath($build->getBuildLogPath());
         $cmd->setStdout($this->options->{'stdout'});
         if (!$this->options->dryrun) {
             $code = $cmd->execute($lastline);
             if ($code !== 0) {
                 throw new SystemCommandException("Install failed: {$lastline}", $build, $build->getBuildLogPath());
             }
         }
     }
     $build->setState(Build::STATE_INSTALL);
 }