本文整理汇总了PHP中GitRepository::isMigratedToGerrit方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::isMigratedToGerrit方法的具体用法?PHP GitRepository::isMigratedToGerrit怎么用?PHP GitRepository::isMigratedToGerrit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::isMigratedToGerrit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
public function getContent()
{
switch ($this->project_creator_status->getStatus($this->repository)) {
case Git_Driver_Gerrit_ProjectCreatorStatus::QUEUE:
return $this->getRemoteRepositoryInfoOnGoing();
case Git_Driver_Gerrit_ProjectCreatorStatus::DONE:
return $this->getRemoteRepositoryInfoDone();
case Git_Driver_Gerrit_ProjectCreatorStatus::ERROR:
return $this->getRemoteRepositoryInfoError();
default:
if ($this->repository->isMigratedToGerrit()) {
return $this->getRemoteRepositoryInfoDone();
}
return '';
}
}
示例2: displayAccessControl
/**
* Display access control management for gitolite backend
*
* @param Integer $project_id Project Id, to manage permissions when performing a cross project fork
*
* @return String
*/
public function displayAccessControl($project_id = null)
{
$project = $project_id ? ProjectManager::instance()->getProject($project_id) : $this->repository->getProject();
$renderer = TemplateRendererFactory::build()->getRenderer(dirname(GIT_BASE_DIR) . '/templates');
$presenter = new GitPresenters_AccessControlPresenter($this->repository->isMigratedToGerrit() ? true : false, 'repo_access[' . Git::PERM_READ . ']', 'repo_access[' . Git::PERM_WRITE . ']', 'repo_access[' . Git::PERM_WPLUS . ']', $this->getOptions($project, Git::PERM_READ), $this->getOptions($project, Git::PERM_WRITE), $this->getOptions($project, Git::PERM_WPLUS));
return $renderer->renderToString('access-control', $presenter);
}
示例3: getAccessURLs
private function getAccessURLs()
{
$urls = $this->repository->getAccessURL();
if ($this->repository->isMigratedToGerrit()) {
$gerrit_user = $this->gerrit_usermanager->getGerritUser($this->current_user);
$gerrit_server = $this->gerrit_servers[$this->repository->getRemoteServerId()];
$driver = $this->driver_factory->getDriver($gerrit_server);
$gerrit_project = $driver->getGerritProjectName($this->repository);
$clone_url = $gerrit_server->getEndUserCloneUrl($gerrit_project, $gerrit_user);
$this->prependGerritCloneURL($urls, $clone_url);
}
return $urls;
}
示例4: checkRepoValidity
/**
*
* @param GitRepository $git_repo
* @param Project $project
* @throws Git_ProjectNotFoundException
* @throws GitRepoNotFoundException
* @throws GitRepoNotInProjectException
* @throws GitRepoNotOnGerritException
*/
private function checkRepoValidity($git_repo, $project)
{
if ($project->isError()) {
throw new Git_ProjectNotFoundException('unable to get config', 404);
}
if (!$git_repo) {
throw new GitRepoNotFoundException('unable to get config', 404);
}
if (!$git_repo->belongsToProject($project)) {
throw new GitRepoNotInProjectException('unable to get config', 403);
}
if (!$git_repo->isMigratedToGerrit()) {
throw new GitRepoNotOnGerritException('unable to get config', 500);
}
}
示例5: itIsNotMigratedIfItWasDisconnected
public function itIsNotMigratedIfItWasDisconnected()
{
$repository = new GitRepository();
$repository->setDeletionDate(null);
$repository->setRemoteServerDisconnectDate(12345677890);
$repository->setRemoteServerId(1);
$this->assertFalse($repository->isMigratedToGerrit());
}
示例6: isMigrationToGerritCompletedWithSuccess
private function isMigrationToGerritCompletedWithSuccess(GitRepository $repository)
{
return $repository->isMigratedToGerrit() && $this->gerrit_status->getStatus($repository) === Git_Driver_Gerrit_ProjectCreatorStatus::DONE;
}