本文整理匯總了PHP中Git::allPermissionTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Git::allPermissionTypes方法的具體用法?PHP Git::allPermissionTypes怎麽用?PHP Git::allPermissionTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Git
的用法示例。
在下文中一共展示了Git::allPermissionTypes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: clonePermissions
public function clonePermissions(GitRepository $old, GitRepository $new)
{
$pm = $this->getPermissionsManager();
if ($this->inSameProject($old, $new)) {
$pm->duplicateWithStatic($old->getId(), $new->getId(), Git::allPermissionTypes());
} else {
$pm->duplicateWithoutStatic($old->getId(), $new->getId(), Git::allPermissionTypes());
}
}
示例2: testClonePermsCrossProjectFork
public function testClonePermsCrossProjectFork()
{
$old_repo_id = 110;
$old_project = new MockProject();
$old_project->setReturnValue('getId', 1);
$new_repo_id = 220;
$new_project = new MockProject();
$new_project->setReturnValue('getId', 2);
$old = new MockGitRepository();
$old->setReturnValue('getId', $old_repo_id);
$old->setReturnValue('getProject', $old_project);
$new = new MockGitRepository();
$new->setReturnValue('getId', $new_repo_id);
$new->setReturnValue('getProject', $new_project);
$backend = $this->_GivenABackendGitolite();
$permissionsManager = $backend->getPermissionsManager();
$permissionsManager->expectOnce('duplicateWithoutStatic', array($old_repo_id, $new_repo_id, Git::allPermissionTypes()));
$backend->clonePermissions($old, $new);
}
示例3: updateRepositoriesPermissions
private function updateRepositoriesPermissions($old_ugroup_id, $new_ugroup_id)
{
$git_permission_type = $this->da->quoteSmartImplode(',', Git::allPermissionTypes());
$sql = "UPDATE permissions\n SET ugroup_id = {$new_ugroup_id}\n WHERE ugroup_id = {$old_ugroup_id}\n AND permission_type IN ({$git_permission_type})\n ";
return $this->update($sql);
}