本文整理汇总了PHP中GitRepository::getFullName方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getFullName方法的具体用法?PHP GitRepository::getFullName怎么用?PHP GitRepository::getFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getFullName方法的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: 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());
}
}
示例3: getPushDetails
/**
*
* Behaviour extracted from official email hook prep_for_email() function
*
* @param GitRepository $repository
* @param PFUser $user
* @param type $oldrev
* @param type $newrev
* @param type $refname
* @return Git_Hook_PushDetails
*/
public function getPushDetails(GitRepository $repository, PFUser $user, $oldrev, $newrev, $refname)
{
$change_type = Git_Hook_PushDetails::ACTION_ERROR;
$revision_list = array();
$rev_type = '';
try {
if ($oldrev == self::FAKE_EMPTY_COMMIT) {
$revision_list = $this->exec_repo->revListSinceStart($refname, $newrev);
$change_type = Git_Hook_PushDetails::ACTION_CREATE;
} elseif ($newrev == self::FAKE_EMPTY_COMMIT) {
$change_type = Git_Hook_PushDetails::ACTION_DELETE;
} else {
$revision_list = $this->exec_repo->revList($oldrev, $newrev);
$change_type = Git_Hook_PushDetails::ACTION_UPDATE;
}
if ($change_type == Git_Hook_PushDetails::ACTION_DELETE) {
$rev_type = $this->exec_repo->getObjectType($oldrev);
} else {
$rev_type = $this->exec_repo->getObjectType($newrev);
}
} catch (Git_Command_Exception $exception) {
$this->logger->error(__CLASS__ . " {$repository->getFullName()} {$refname} {$oldrev} {$newrev} " . $exception->getMessage());
}
return new Git_Hook_PushDetails($repository, $user, $refname, $change_type, $rev_type, $revision_list);
}
示例4: 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() . '/';
}
}
示例5: 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;
}
示例6: getRepositoryPushesByWeek
/**
* Collect, into an array, logged git pushes matching a given git repository for the given duration.
*
* @param GitRepository $repository Git repository we want to fetch its pushes
*
* @return Array
*/
private function getRepositoryPushesByWeek(GitRepository $repository)
{
$pushes = array();
$gitLogDao = new Git_LogDao();
foreach ($this->weekNum as $key => $w) {
$res = $gitLogDao->getRepositoryPushesByWeek($repository->getId(), $w, $this->year[$key]);
if ($res && !$res->isError() && $res->valid()) {
$row = $res->getRow();
$pushes[$key] = intval($row['pushes']);
if ($pushes[$key] > 0) {
$this->displayChart = true;
$this->legend = $repository->getFullName();
}
}
$pushes = array_pad($pushes, $this->weeksNumber, 0);
}
return $pushes;
}
示例7: repoFullName
public function repoFullName(GitRepository $repo, $unix_name)
{
require_once GIT_BASE_DIR . '/PathJoinUtil.php';
return unixPathJoin(array($unix_name, $repo->getFullName()));
}
示例8: getView
/**
* Configure gitphp output
*
* @param GitRepository $repository
*/
public function getView($repository)
{
include_once 'common/include/Codendi_HTMLPurifier.class.php';
if (empty($_REQUEST['a'])) {
$_REQUEST['a'] = 'summary';
}
set_time_limit(300);
$_GET['a'] = $_REQUEST['a'];
$_REQUEST['group_id'] = $this->groupId;
$_REQUEST['repo_id'] = $repository->getId();
$_REQUEST['repo_name'] = $repository->getFullName();
$_GET['p'] = $_REQUEST['repo_name'] . '.git';
$_REQUEST['repo_path'] = $repository->getPath();
$_REQUEST['project_dir'] = $repository->getProject()->getUnixName();
$_REQUEST['git_root_path'] = $repository->getGitRootPath();
$_REQUEST['action'] = 'view';
if (empty($_REQUEST['noheader'])) {
//echo '<hr>';
echo '<div id="gitphp">';
}
include $this->getGitPhpIndexPath();
if (empty($_REQUEST['noheader'])) {
echo '</div>';
}
}
示例9: delete
public function delete(GitRepository $repository)
{
$id = $repository->getId();
$projectId = $repository->getProjectId();
$id = $this->da->escapeInt($id);
$projectId = $this->da->escapeInt($projectId);
if (empty($id) || empty($projectId)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_delete_params'));
}
$deletionDate = $repository->getDeletionDate();
$projectName = $repository->getProject()->getUnixName();
$backup_path = str_replace('/', '_', $repository->getFullName());
$backup_path .= '_' . strtotime($deletionDate);
$backup_path = $projectName . '_' . $backup_path;
$backup_path = $this->da->quoteSmart($backup_path);
$deletionDate = $this->da->quoteSmart($deletionDate);
$query = ' UPDATE ' . $this->getTable() . ' SET ' . self::REPOSITORY_DELETION_DATE . '=' . $deletionDate . ', ' . self::REPOSITORY_BACKUP_PATH . '=' . $backup_path . ' WHERE ' . self::REPOSITORY_ID . '=' . $id . ' AND ' . self::FK_PROJECT_ID . '=' . $projectId;
$r = $this->update($query);
$ar = $this->da->affectedRows();
if ($r === false || $ar == 0) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_delete_error') . ' ' . $this->da->isError());
}
if ($ar == 1) {
return true;
}
return false;
}
示例10: getRepositoryFullName
private function getRepositoryFullName(GitRepository $repository)
{
return $repository->getFullName();
}
示例11: getGerritProjectName
public function getGerritProjectName(GitRepository $repository)
{
$project = $repository->getProject()->getUnixName();
$repo = $repository->getFullName();
return "{$project}/{$repo}";
}
示例12: redirectIfTryingToViewRepositoryAndUserFriendlyURLsActivated
private function redirectIfTryingToViewRepositoryAndUserFriendlyURLsActivated(Project $project, GitRepository $repository, $parameters)
{
if (!$this->getPlugin()->areFriendlyUrlsActivated()) {
return;
}
$request_parameters = $parameters ? '?' . $parameters : '';
$redirecting_url = GIT_BASE_URL . '/' . $project->getUnixName() . '/' . $repository->getFullName() . $request_parameters;
header("Location: {$redirecting_url}", TRUE, 301);
}
示例13: getHTTPAccessURL
public function getHTTPAccessURL(GitRepository $repository)
{
$http_url = $this->getConfigurationParameter('git_http_url');
if ($http_url) {
return $http_url . '/' . $repository->getProject()->getUnixName() . '/' . $repository->getFullName() . '.git';
}
}
示例14: getLinkToRepositoryManagement
private function getLinkToRepositoryManagement(GitRepository $repository)
{
$project = $repository->getProject();
return '<a href="/plugins/git/?action=repo_management&group_id=' . $project->getId() . '&repo_id=' . $repository->getId() . '">' . $project->getUnixName() . '/' . $repository->getFullName() . '</a>';
}
示例15: __construct
public function __construct(GitRepository $repository, array $used_mirrors)
{
$this->repository_id = $repository->getId();
$this->name = $repository->getFullName();
$this->used_mirrors = $used_mirrors;
}