repo_url = $repo_url; } function setModule($module) { $this->module = $module; } function setBranch($branch) { $this->branch = $branch; } public function export($dest, $revision = false) { $cmd = $this->svn_cmd . ' export -q ' . $this->repo_url . $this->module. $this->branch . ' ' . $dest; $res = exec_single_log($cmd); if ($res === FALSE) { throw new \Exception('svn export failed <' . $this->repo_url . '/' . $this->module. '/' . $this->branch . '>'); } } public function info() { } public function getLastCommitId() { $path = $this->repo_url . $this->module. $this->branch; $cmd = $this->svn_cmd . ' info --xml ' . $path; $res = exec_sep_log($cmd); if ($res && is_null($res['log_stdout'])) { throw new \Exception('svn log failed <' . $this->repo_url . '/' . $this->module. '/' . $this->branch . '>'); } $sx = new \SimpleXMLElement($res['log_stdout']); if (!$sx) { throw new \Exception('svn log failed ' . $path); } $revision = (int)($sx->entry->commit['revision']); return $revision; } }