Example #1
0
 /**
  * (non-PHPdoc)
  * @see Webcreate\Vcs\Common\Adapter.AdapterInterface::execute()
  *
  * @return mixed
  */
 public function execute($command, array $arguments = array(), $cwd = null)
 {
     $bincommand = $this->bin . ' ' . $command;
     $arguments += $this->getGlobalArguments();
     $commandline = $this->cli->prepare($bincommand, $arguments);
     if ($this->cli->execute($commandline, null, $cwd) != 0) {
         throw new ProcessFailedException($this->cli->getProcess());
     }
     return $this->parse($command, $arguments, $this->cli->getOutput());
 }
Example #2
0
 /**
  * Executes a svnadmin command
  *
  * @param  string                 $command
  * @param  array                  $arguments
  * @throws ProcessFailedException
  * @throws \RuntimeException
  * @return string
  */
 protected function exec($command, array $arguments = array())
 {
     $command = $this->bin . ' ' . $command;
     $commandline = $this->cli->prepare($command, $arguments);
     if ($this->cli->execute($commandline) != 0) {
         throw new ProcessFailedException($this->cli->getProcess());
     } elseif ($message = $this->cli->getErrorOutput()) {
         throw new \RuntimeException($message);
     }
     return $this->cli->getOutput();
 }