当前位置: 首页>>代码示例>>PHP>>正文


PHP GitRepository::getName方法代码示例

本文整理汇总了PHP中GitRepository::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getName方法的具体用法?PHP GitRepository::getName怎么用?PHP GitRepository::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GitRepository的用法示例。


在下文中一共展示了GitRepository::getName方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 /**
  * Create a new GitRepository through its backend
  *
  * @param  GitRepository $repository
  * @throws Exception
  */
 public function create(GitRepository $repository)
 {
     if (!$repository->isNameValid($repository->getName())) {
         throw new Exception($GLOBALS['Language']->getText('plugin_git', 'actions_input_format_error', array($repository->getBackend()->getAllowedCharsInNamePattern(), GitDao::REPO_NAME_MAX_LENGTH)));
     }
     $this->assertRepositoryNameNotAlreadyUsed($repository);
     $repository->getBackend()->createReference($repository);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:14,代码来源:GitRepositoryManager.class.php

示例2: 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;
 }
开发者ID:blestab,项目名称:tuleap,代码行数:8,代码来源:MirrorUpdater.php

示例3: create

 /**
  * Create a new GitRepository through its backend
  *
  * @param  GitRepository $repository
  * @throws Exception
  */
 public function create(GitRepository $repository, GitRepositoryCreator $creator)
 {
     if (!$creator->isNameValid($repository->getName())) {
         throw new Exception($GLOBALS['Language']->getText('plugin_git', 'actions_input_format_error', array($creator->getAllowedCharsInNamePattern(), GitDao::REPO_NAME_MAX_LENGTH)));
     }
     $this->assertRepositoryNameNotAlreadyUsed($repository);
     $id = $this->dao->save($repository);
     $repository->setId($id);
     $this->git_system_event_manager->queueRepositoryUpdate($repository);
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:16,代码来源:GitRepositoryManager.class.php

示例4: makeGerritProjectReadOnly

 private function makeGerritProjectReadOnly(GitRepository $repository, Git_RemoteServer_GerritServer $server, Project $project)
 {
     try {
         $this->driver_factory->getDriver($server)->makeGerritProjectReadOnly($server, $project->getUnixName() . '/' . $repository->getName());
     } catch (Exception $e) {
         $this->error($e->getMessage() . $e->getTraceAsString());
         return false;
     }
     $this->done();
     return true;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:SystemEvent_GIT_GERRIT_PROJECT_READONLY.class.php

示例5: __construct

 public function __construct(GitRepository $repository, array $urls, array $mirrors, $user_is_admin, $master_location_name)
 {
     $this->repository = $repository;
     $this->urls = $urls;
     $this->mirrors = $mirrors;
     $this->user_is_admin = $user_is_admin;
     $this->settings_text = $GLOBALS['Language']->getText('global', 'Settings');
     $this->how_to_use_text = $GLOBALS['Language']->getText('plugin_git', 'how_to_use_text');
     $this->clone_text = $GLOBALS['Language']->getText('plugin_git', 'clone_text');
     $this->add_remote_text = $GLOBALS['Language']->getText('plugin_git', 'add_remote_text');
     $this->ssh_mirrors_text = $GLOBALS['Language']->getText('plugin_git', 'ssh_mirrors_text');
     $this->repository_name = $repository->getName();
     $this->master_location_name = $master_location_name;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:RepositoryClonePresenter.class.php

示例6: deleteGerritProject

 private function deleteGerritProject(GitRepository $repository, Git_RemoteServer_GerritServer $server, Project $project, $backend)
 {
     try {
         $this->driver_factory->getDriver($server)->deleteProject($server, $project->getUnixName() . '/' . $repository->getName());
         $backend->setGerritProjectAsDeleted($repository);
     } catch (Exception $e) {
         $this->error($e->getMessage() . $e->getTraceAsString());
         return false;
     }
     $this->done();
     return true;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:SystemEvent_GIT_GERRIT_PROJECT_DELETE.class.php

示例7: mirroring_info

 public function mirroring_info()
 {
     return $GLOBALS['Language']->getText('plugin_git', 'mirroring_info', array($this->repository->getName()));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:MirroringPresenter.php

示例8: GitRepository

 function permissions_for_ugroup($params)
 {
     if (!$params['results']) {
         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();
                 $params['results'] = $repository->getName();
             } catch (Exception $e) {
                 // do nothing
             }
         }
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:16,代码来源:gitPlugin.class.php

示例9: getAccessURL

 /**
  * Return URL to access the respository for remote git commands
  *
  * @param  GitRepository $repository
  * @return String
  */
 public function getAccessURL(GitRepository $repository)
 {
     $serverName = $_SERVER['SERVER_NAME'];
     $user = UserManager::instance()->getCurrentUser();
     return array('ssh' => $user->getUserName() . '@' . $serverName . ':/gitroot/' . $repository->getProject()->getUnixName() . '/' . $repository->getName() . '.git');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:GitBackend.class.php

示例10: save

 public function save(GitRepository $repository)
 {
     $id = (int) $repository->getId();
     $name = $repository->getName();
     $mailPrefix = $repository->getMailPrefix();
     $parentId = 0;
     $scope = $repository->getScope();
     $namespace = $repository->getNamespace();
     try {
         $parent = $repository->getParent();
         if (!empty($parent)) {
             $parentId = $parent->getId();
         }
     } catch (GitDaoException $e) {
     }
     $projectId = $repository->getProjectId();
     $description = $repository->getDescription();
     $path = $repository->getPath();
     $isInitialized = $repository->getIsInitialized();
     $creationUserId = $repository->getCreatorId();
     $access = $repository->getAccess();
     //protect parameters
     $id = $this->da->escapeInt($id);
     $name = $this->da->quoteSmart($name);
     $description = $this->da->quoteSmart($description);
     $path = $this->da->quoteSmart($path);
     $projectId = $this->da->escapeInt($projectId);
     $isInitialized = $this->da->escapeInt($isInitialized);
     $creationUserId = $this->da->escapeInt($creationUserId);
     $access = $this->da->quoteSmart($access);
     $mailPrefix = $this->da->quoteSmart($mailPrefix);
     $scope = $this->da->quoteSmart($scope);
     $namespace = $this->da->quoteSmart($namespace);
     $backup_path = $this->da->quoteSmart($repository->getBackupPath());
     $insert = false;
     if ($this->exists($id)) {
         $query = 'UPDATE ' . $this->getTable() . ' SET ' . self::REPOSITORY_DESCRIPTION . '=' . $description . ',' . self::REPOSITORY_IS_INITIALIZED . '=' . $isInitialized . ',' . self::REPOSITORY_ACCESS . '=' . $access . ',' . self::REPOSITORY_MAIL_PREFIX . '=' . $mailPrefix . ',' . self::REPOSITORY_BACKUP_PATH . '=' . $backup_path . 'WHERE ' . self::REPOSITORY_ID . '=' . $id;
     } else {
         if ($repository->getBackend() instanceof Git_Backend_Gitolite) {
             $backendType = self::BACKEND_GITOLITE;
         } else {
             $backendType = self::BACKEND_GITSHELL;
         }
         $insert = true;
         $creationDate = date('Y-m-d H:i:s');
         $query = 'INSERT INTO ' . $this->getTable() . '(' . self::REPOSITORY_NAME . ',' . self::REPOSITORY_PATH . ',' . self::REPOSITORY_PARENT . ',' . self::REPOSITORY_DESCRIPTION . ',' . self::FK_PROJECT_ID . ',' . self::REPOSITORY_CREATION_DATE . ',' . self::REPOSITORY_CREATION_USER_ID . ',' . self::REPOSITORY_IS_INITIALIZED . ',' . self::REPOSITORY_ACCESS . ',' . self::REPOSITORY_BACKEND_TYPE . ',' . self::REPOSITORY_SCOPE . ',' . self::REPOSITORY_NAMESPACE . ') values (' . "" . $name . "," . "" . $path . "," . "" . $parentId . "," . "" . $description . "," . $projectId . "," . "'" . $creationDate . "'," . $creationUserId . "," . $isInitialized . ',' . $access . ',' . $this->da->quoteSmart($backendType) . ',' . $scope . ',' . $namespace . ')';
     }
     if ($this->update($query) === false) {
         throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_update_error') . ' : ' . $this->da->isError());
     }
     if ($insert) {
         return $this->da->lastInsertId();
     }
     return true;
 }
开发者ID:blestab,项目名称:tuleap,代码行数:55,代码来源:GitDao.class.php

示例11: restoreArchivedRepository

 /**
  *
  * Restore archived Gitolite repositories
  *
  * @param GitRepository $repository
  *
  */
 public function restoreArchivedRepository(GitRepository $repository)
 {
     $this->logger->info('[Gitolite]Restoring repository : ' . $repository->getName());
     $backup_directory = realpath($this->getGitPlugin()->getConfigurationParameter('git_backup_dir') . '/');
     return $this->getDriver()->restoreRepository($repository, $this->getGitRootPath(), $backup_directory);
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:13,代码来源:Git_Backend_Gitolite.class.php

示例12: createFromBundle

 public function createFromBundle(GitRepository $repository, GitRepositoryCreator $creator, $bundle_path)
 {
     if (!$creator->isNameValid($repository->getName())) {
         throw new Exception($GLOBALS['Language']->getText('plugin_git', 'actions_input_format_error', array($creator->getAllowedCharsInNamePattern(), GitDao::REPO_NAME_MAX_LENGTH)));
     }
     $this->assertRepositoryNameNotAlreadyUsed($repository);
     $id = $this->dao->save($repository);
     $repository->setId($id);
     $bundle_path_arg = escapeshellarg($bundle_path);
     $repository_full_path_arg = escapeshellarg($repository->getFullPath());
     $this->system_command->exec("sudo -u gitolite /usr/share/tuleap/plugins/git/bin/gl-clone-bundle.sh {$bundle_path_arg} {$repository_full_path_arg}");
     $this->git_system_event_manager->queueRepositoryUpdate($repository);
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:13,代码来源:GitRepositoryManager.class.php

示例13: fork

 /**
  * @throws GitRepositoryAlreadyExistsException 
  */
 public function fork(GitRepository $old, GitRepository $new)
 {
     $name = $old->getName();
     //TODO use $old->getRootPath() (good luck for Unit Tests!)
     $old_namespace = $old->getProject()->getUnixName() . '/' . $old->getNamespace();
     $new_namespace = $new->getProject()->getUnixName() . '/' . $new->getNamespace();
     $new_project = $new->getProject();
     if ($this->getDao()->isRepositoryExisting($new_project->getId(), $new->getPath())) {
         throw new GitRepositoryAlreadyExistsException('Respository already exists');
     } else {
         $forkSucceeded = $this->getDriver()->fork($name, $old_namespace, $new_namespace);
         if ($forkSucceeded) {
             $id = $this->getDao()->save($new);
             $new->setId($id);
             $this->clonePermissions($old, $new);
             $this->updateRepoConf($new);
         }
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:22,代码来源:Git_Backend_Gitolite.class.php


注:本文中的GitRepository::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。