本文整理汇总了PHP中GitRepository::getProjectId方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getProjectId方法的具体用法?PHP GitRepository::getProjectId怎么用?PHP GitRepository::getProjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getProjectId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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>';
}
}
示例2: queueRepositoryDeletion
public function queueRepositoryDeletion(GitRepository $repository)
{
if ($repository->getBackend() instanceof Git_Backend_Gitolite) {
$this->system_event_manager->createEvent(SystemEvent_GIT_REPO_DELETE::NAME, $repository->getProjectId() . SystemEvent::PARAMETER_SEPARATOR . $repository->getId(), SystemEvent::PRIORITY_MEDIUM, SystemEvent::OWNER_APP);
} else {
$this->system_event_manager->createEvent(SystemEvent_GIT_LEGACY_REPO_DELETE::NAME, $repository->getProjectId() . SystemEvent::PARAMETER_SEPARATOR . $repository->getId(), SystemEvent::PRIORITY_MEDIUM, SystemEvent::OWNER_ROOT);
}
}
示例3: 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;
}
示例4: 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;
}
示例5: 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() . '/';
}
}
示例6: 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());
}
}
示例7: project_id
public function project_id()
{
return $this->repository->getProjectId();
}
示例8: GitRepository
function permission_user_allowed_to_change($params)
{
if (!$params['allowed']) {
if (!$this->_cached_permission_user_allowed_to_change) {
if (in_array($params['permission_type'], array('PLUGIN_GIT_READ', 'PLUGIN_GIT_WRITE', 'PLUGIN_GIT_WPLUS'))) {
require_once 'GitRepository.class.php';
$repository = new GitRepository();
$repository->setId($params['object_id']);
try {
$repository->load();
//Only project admin can update perms of project repositories
//Only repo owner can update perms of personal repositories
$user = UserManager::instance()->getCurrentUser();
$this->_cached_permission_user_allowed_to_change = $repository->belongsTo($user) || $user->isMember($repository->getProjectId(), 'A');
} catch (Exception $e) {
// do nothing
}
}
}
$params['allowed'] = $this->_cached_permission_user_allowed_to_change;
}
}
示例9: 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>';
}
示例10: userCanRead
/**
* Test is user can read the content of this repository and metadata
*
* @param PFUser $user The user to test
* @param GitRepository $repository The repository to test
*
* @return Boolean
*/
public function userCanRead($user, $repository)
{
if ($repository->isPrivate() && $user->isMember($repository->getProjectId())) {
return true;
}
if ($repository->isPublic()) {
if ($user->isRestricted() && $user->isMember($repository->getProjectId())) {
return true;
}
if (!$user->isAnonymous()) {
return true;
}
}
return false;
}
示例11: getRepoAdminUrl
public function getRepoAdminUrl()
{
return '/plugins/git/?action=repo_management&group_id=' . $this->repository->getProjectId() . '&repo_id=' . $this->repository->getId();
}
示例12: markAsDeleted
private function markAsDeleted(GitRepository $repository)
{
$repository->markAsDeleted();
$this->systemEventManager->createEvent('GIT_REPO_DELETE', $repository->getProjectId() . SystemEvent::PARAMETER_SEPARATOR . $repository->getId(), SystemEvent::PRIORITY_MEDIUM);
}
示例13: getProjectRepository
/**
* This function initialize a GitRepository object with its database value
* @param GitRepository $repository
* @return <type>
*/
public function getProjectRepository($repository)
{
$projectId = $repository->getProjectId();
$repositoryPath = $repository->getPathWithoutLazyLoading();
if (empty($projectId) || empty($repositoryPath)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_search_params'));
}
$rs = $this->searchProjectRepositoryByPath($projectId, $repositoryPath);
if (empty($rs)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_search_error'));
return false;
}
$result = $rs->getRow();
if (empty($result)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_search_error'));
return false;
}
$this->hydrateRepositoryObject($repository, $result);
return true;
}
示例14: searchOtherRepositoriesInSameProjectFromRepositoryList
/**
* @param GitRepository $repository
* @param array $repositor_ids
* @return array
*/
public function searchOtherRepositoriesInSameProjectFromRepositoryList(GitRepository $repository, $repositor_ids)
{
$project_repositories = array();
$result = $this->getDao()->searchRepositoriesInSameProjectFromRepositoryList($repositor_ids, $repository->getProjectId());
if (!$result) {
return $project_repositories;
}
foreach ($result as $repo) {
if ($repo['repository_id'] == $repository->getId()) {
continue;
}
$project_repositories[] = $repo['repository_id'];
}
return $project_repositories;
}
示例15: userCanRead
/**
* Test is user can read the content of this repository and metadata
*
* @param User $user The user to test
* @param GitRepository $repository The repository to test
*
* @return Boolean
*/
public function userCanRead($user, $repository)
{
return $user->isMember($repository->getProjectId(), 'A') || $user->hasPermission(Git::PERM_READ, $repository->getId(), $repository->getProjectId()) || $user->hasPermission(Git::PERM_WRITE, $repository->getId(), $repository->getProjectId()) || $user->hasPermission(Git::PERM_WPLUS, $repository->getId(), $repository->getProjectId());
}