path = BSFunctions::FetchSourcePath($path); $this->container = (bool)$iscontainer; if ($this->container) { if ($dir = @opendir($this->path)) { while (($file = readdir($dir)) !== false) { if (is_dir($this->path . $file) AND $file{0} != '.' AND is_dir($this->path . $file . '/' . 'db')) { $this->repositories[] = $file; } } closedir($dir); } } else { if (is_dir($this->path . 'db')) { $this->repositories[] = $this->path; } } sort($this->repositories); if (sizeof($this->repositories) < 1) { $viewsvn->trigger->error(_('There are no valid repositories')); } } // ################################################################### /** * Returns a list of repositories * * @return array List of repositories */ public function fetchList() { return $this->repositories; } // ################################################################### /** * Returns a path to a repository * * @param string Repository name * * @return string Full path to the repository */ public function fetchPath($repository = '') { global $viewsvn; if (!in_array($repository, $this->repositories)) { $viewsvn->trigger->error(_('Invalid repository name specified')); } if ($this->container) { return 'file://' . $this->path . $repository; } else { return 'file://' . $this->path; } } // ################################################################### /** * Verifies a path inside a repository * * @param string Repository name * @param string Path * * @return bool Validity */ public function verify($repos, $path) { global $viewsvn; if ($repospath = $this->fetchPath($repos)) { return true; } else { return false; } } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>