本文整理汇总了PHP中GitRepository::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getId方法的具体用法?PHP GitRepository::getId怎么用?PHP GitRepository::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEvent
private function getEvent(GitRepository $repository)
{
if (!isset($this->cache[$repository->getId()])) {
$this->cache[$repository->getId()] = $this->dao->getSystemEventForRepository($repository->getId());
}
return $this->cache[$repository->getId()];
}
示例2: getView
private function getView()
{
if (empty($_REQUEST['a'])) {
$_REQUEST['a'] = 'summary';
} else {
if ($_REQUEST['a'] === 'blobdiff' && isset($_REQUEST['jenkins']) && $_REQUEST['jenkins'] === 'true') {
$this->inverseURLArgumentsForGitPhpDiff();
}
}
set_time_limit(300);
$_GET['a'] = $_REQUEST['a'];
$_REQUEST['group_id'] = $this->repository->getProjectId();
$_REQUEST['repo_id'] = $this->repository->getId();
$_REQUEST['repo_name'] = $this->repository->getFullName();
$_GET['p'] = $_REQUEST['repo_name'] . '.git';
$_REQUEST['repo_path'] = $this->repository->getPath();
$_REQUEST['project_dir'] = $this->repository->getProject()->getUnixName();
$_REQUEST['git_root_path'] = $this->repository->getGitRootPath();
$_REQUEST['action'] = 'view';
$this->preSanitizeRequestForGitphp();
if (empty($_REQUEST['noheader'])) {
echo '<div id="gitphp" class="plugin_git_gitphp">';
}
include $this->getGitPhpIndexPath();
if (empty($_REQUEST['noheader'])) {
echo '</div>';
}
}
示例3: updateRepositoryMirrors
public function updateRepositoryMirrors(GitRepository $repository, array $mirror_ids)
{
if ($this->mirror_data_mapper->doesAllSelectedMirrorIdsExist($mirror_ids) && $this->mirror_data_mapper->unmirrorRepository($repository->getId()) && $this->mirror_data_mapper->mirrorRepositoryTo($repository->getId(), $mirror_ids)) {
$this->history_dao->groupAddHistory("git_repo_mirroring_update", $repository->getName(), $repository->getProjectId());
return true;
}
return false;
}
示例4: getRemoteRepositoryInfoError
private function getRemoteRepositoryInfoError()
{
$date = DateHelper::timeAgoInWords($this->project_creator_status->getEventDate($this->repository), false, true);
$url = GIT_BASE_URL . '/?action=repo_management&group_id=' . $this->repository->getProjectId() . '&repo_id=' . $this->repository->getId() . '&pane=gerrit';
$html = '';
$html .= '<div class="alert alert-error gerrit_url">';
$html .= $GLOBALS['Language']->getText('plugin_git', 'delegated_to_gerrit_error', array($date, $url), CODENDI_PURIFIER_DISABLED);
$html .= '</div>';
return $html;
}
示例5: launchForRepository
private function launchForRepository(GitRepository $repository)
{
$res = $this->dao->retrieveTriggersPathByRepository($repository->getId());
if ($res && !$res->isError() && $res->rowCount() > 0) {
foreach ($res as $row) {
try {
$this->jenkins_client->setToken($row['token'])->launchJobBuild($row['job_url']);
} catch (Exception $exception) {
$this->logger->error(__CLASS__ . '[' . $repository->getId() . '] ' . $exception->getMessage());
}
}
}
}
示例6: getItemWrapper
/**
* Get Item wrapper
*
* @param GitRepository $repo the string representation of the item
* @param string $inner the string representation of the item
*
* @return string the $inner encapsulated in its own wrapper
*/
protected function getItemWrapper(GitRepository $repo, $inner)
{
if ($repo->getBackend() instanceof Git_Backend_Gitolite) {
return '<option value="' . $repo->getId() . '">' . $inner . '</option>';
}
return '';
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:GitViewsRepositoriesTraversalStrategy_Selectbox.class.php
示例7: getRepositoryBaseUrl
/**
* @param GitRepository $repository
* @return string the base url to access the git repository regarding plugin configuration
*/
public function getRepositoryBaseUrl(GitRepository $repository)
{
if ($this->git_plugin->areFriendlyUrlsActivated()) {
return GIT_BASE_URL . '/' . $repository->getProject()->getUnixName() . '/' . $repository->getFullName();
} else {
return GIT_BASE_URL . '/index.php/' . $repository->getProjectId() . '/view/' . $repository->getId() . '/';
}
}
示例8: canBeReadByAnonymous
private function canBeReadByAnonymous(GitRepository $repository)
{
$ugroup_ids = $this->permissions_manager->getAuthorizedUgroupIds($repository->getId(), Git::PERM_READ);
foreach ($ugroup_ids as $ugroup_id) {
if ($ugroup_id == ProjectUGroup::ANONYMOUS) {
return true;
}
}
return false;
}
示例9: sendErrorNotification
private function sendErrorNotification(GitRepository $repository)
{
$user = $this->getRequester();
if (!$user->isAnonymous()) {
$factory = new BaseLanguageFactory();
$language = $factory->getBaseLanguage($user->getLocale());
$url = get_server_url() . GIT_BASE_URL . '/?action=repo_management&group_id=' . $repository->getProjectId() . '&repo_id=' . $repository->getId() . '&pane=gerrit';
$notification = new Notification(array($user->getEmail()), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_subject', array($repository->getFullName())), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_body', array($repository->getFullName(), $url)), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_body', array($repository->getFullName(), $url)), $url, 'git');
$this->mail_builder->buildAndSendEmail($repository->getProject(), $notification, new MailEnhancer());
}
}
示例10: areRegisteredUsersAllowedTo
/** @return bool */
public function areRegisteredUsersAllowedTo($permission_type, GitRepository $repository)
{
if ($permission_type == Git::SPECIAL_PERM_ADMIN) {
return false;
}
foreach ($this->permissions_manager->getAuthorizedUgroups($repository->getId(), $permission_type) as $row) {
if ($row['ugroup_id'] == ProjectUGroup::REGISTERED || $row['ugroup_id'] == ProjectUGroup::ANONYMOUS || $row['ugroup_id'] == ProjectUGroup::AUTHENTICATED) {
return true;
}
}
}
示例11: getOptions
private function getOptions(Project $project, $permission)
{
$user_groups = $this->user_group_factory->getAllForProject($project);
$options = array();
$selected_values = $this->permissions_manager->getAuthorizedUGroupIdsForProject($project, $this->repository->getId(), $permission);
foreach ($user_groups as $ugroup) {
if ($ugroup->getId() == ProjectUGroup::ANONYMOUS && $permission !== Git::PERM_READ) {
continue;
}
$selected = in_array($ugroup->getId(), $selected_values) ? 'selected="selected"' : '';
$options[] = array('value' => $ugroup->getId(), 'label' => $ugroup->getName(), 'selected' => $selected);
}
return $options;
}
示例12: getHeader
private function getHeader()
{
$html = '';
$repoId = $this->repository->getId();
$creator = $this->repository->getCreator();
$parent = $this->repository->getParent();
$access = $this->repository->getAccess();
$creatorName = '';
if (!empty($creator)) {
$creatorName = UserHelper::instance()->getLinkOnUserFromUserId($creator->getId());
}
// Access type
$accessType = $this->getAccessType($access, $this->repository->getBackend() instanceof Git_Backend_Gitolite);
$html .= '<h1>' . $accessType . $this->repository->getFullName() . '</h1>';
if (!empty($parent)) {
$html .= '<div id="plugin_git_repo_parent">';
$html .= $GLOBALS['Language']->getText('plugin_git', 'view_repo_parent_' . $this->repository->getBackendType(), $parent->getHTMLLink($this->url_manager));
$html .= '</div>';
}
return $html;
}
示例13: test
public function test(GitRepository $compare)
{
return $compare->getId() === $this->repository_id;
}
示例14: displayTab
private function displayTab($pane)
{
echo '<li class="' . ($this->current_pane == $pane->getIdentifier() ? 'active' : '') . '">';
$url = GIT_BASE_URL . '/?' . http_build_query(array('action' => 'repo_management', 'group_id' => $this->repository->getProjectId(), 'repo_id' => $this->repository->getId(), 'pane' => $pane->getIdentifier()));
echo '<a href="' . $url . '">' . $pane->getTitle() . '</a></li>';
}
示例15: areThereAnyChanges
private function areThereAnyChanges(GitRepository $repository, array $mirror_ids, array $current_mirror_ids_per_repository)
{
$current_mirrors = array();
if (isset($current_mirror_ids_per_repository[$repository->getId()])) {
$current_mirrors = $current_mirror_ids_per_repository[$repository->getId()];
}
return count(array_diff($mirror_ids, $current_mirrors)) > 0 || count(array_diff($current_mirrors, $mirror_ids)) > 0;
}