path = $path; $access = $this->run('--version'); if (!preg_match('#^svn, version (.*?)\)$#i', trim($access[0]))) { throw new Exception(_('The SVN binary does not appear to be valid (it failed our tests)')); } } // ################################################################### /** * Wrapper for escapeshellarg() * * @param string The argument * * @return string Cleaned argument */ public function arg($argument) { return escapeshellarg($argument); } // ################################################################### /** * Wrapper for escapeshellcmd() * * @param string Command * * @return string Cleaned command */ public function cmd($command) { return escapeshellcmd($command); } // ################################################################### /** * Executes a shell command and returns all the output * as an array * * @param string UNIX command * @param bool Turn the array of output into a string? * * @return array Output */ public function run($command, $implode = false) { $start = microtime(); exec($this->path . ' ' . $command, $output); BSRegister::Debug("exec(" . BSFunctions::FetchMicrotimeDiff($start) . "): $command"); if ($implode) { return implode("\n", $output); } return $output; } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>