/** @see Event::GET_PROJECTID_FROM_URL */ public function get_projectid_from_url($params) { if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0) { $url = new Git_URL(ProjectManager::instance(), $this->getRepositoryFactory(), $_SERVER['REQUEST_URI']); if ($url->isSmartHTTP()) { return; } $project = $url->getProject(); if ($project && !$project->isError()) { $params['project_id'] = $url->getProject()->getId(); } } }
private function routeUsingStandardURLs(Git_URL $url) { if (!$url->isStandard()) { return; } $repository = $url->getRepository(); if (!$repository) { $this->addError('Bad request'); $this->redirect('/'); return; } $project = $url->getProject(); $this->redirectIfTryingToViewRepositoryAndUserFriendlyURLsActivated($project, $repository, $url->getParameters()); $this->request->set('group_id', $project->getId()); $this->request->set('action', 'view'); $this->request->set('repo_id', $repository->getId()); }