/** * Returns the Project that match the given string * * @param String $repository_path * @return Project * @throws Exception */ public function getProjectFromRepositoryPath($repository_path) { $unix_group_name = substr($repository_path, strlen(ForgeConfig::get('svn_prefix')) + 1); $project = $this->project_manager->getProjectByUnixName($unix_group_name); if ($project && !$project->isError() && !$project->isDeleted()) { return $project; } throw new Exception('Invalid project'); }
public function renameProject($old_name, $new_name) { $git_modifications = new Git_Gitolite_GitModifications(); $project = $this->project_manager->getProjectByUnixName($new_name); $this->moveProjectFiles($old_name, $new_name, $git_modifications, $project); $this->modifyProjectConf($old_name, $new_name, $git_modifications, $project); $this->modifyIncludersConf($old_name, $new_name, $git_modifications, $project); return $git_modifications; }
/** * * @param String $projectName * @param String $path * * @return GitRepository */ public function getByProjectNameAndPath($projectName, $path) { $project = $this->projectManager->getProjectByUnixName($projectName); if ($project) { return $this->getRepositoryByPath($project->getID(), $projectName . '/' . $path); } return null; }