path = $viewsvn->fetch_sourcepath($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($viewsvn->lang->string('There are no valid repositories')); } } // ################################################################### /** * Returns a list of repositories * * @access public * * @return array List of repositories */ function fetch_list() { return $this->repositories; } // ################################################################### /** * Returns a path to a repository * * @access public * * @param string Repository name * * @return string Full path to the repository */ function fetch_path($repository = '') { global $viewsvn; if (!in_array($repository, $this->fetch_list())) { $viewsvn->trigger->error($viewsvn->lang->string('Invalid repository name specified')); } if ($this->container) { return 'file://' . $this->path . $repository; } else { return 'file://' . $this->path; } } // ################################################################### /** * Verifies a path inside a repository * * @access public * * @param string Repository name * @param string Path * * @return bool Validity */ function verify($repos, $path) { global $viewsvn; if ($repospath = $this->fetch_path($repos)) { return true; } else { return false; } } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>