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


PHP GitRepository::getBackend方法代码示例

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


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

示例1: 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

示例2: 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

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

示例4: save

 /**
  * This method allows one to save any repository attribues changes from the web interface.
  * @param <type> $repoId
  * @param <type> $repoAccess
  * @param <type> $repoDescription
  * @return <type>
  */
 public function save($projectId, $repoId, $repoAccess, $repoDescription)
 {
     $c = $this->getController();
     if (empty($repoId)) {
         $c->addError($this->getText('actions_params_error'));
         $c->redirect('/plugins/git/?action=index&group_id=' . $projectId);
         return false;
     }
     if (empty($repoAccess) || empty($repoDescription)) {
         $c->addError($this->getText('actions_params_error'));
         $c->redirect('/plugins/git/index.php/' . $projectId . '/view/' . $repoId . '/');
         return false;
     }
     $repository = new GitRepository();
     $repository->setId($repoId);
     try {
         $repository->load();
         if (!empty($repoAccess)) {
             if ($repository->getBackend() instanceof Git_Backend_Gitolite) {
                 $repository->getBackend()->savePermissions($repository, $repoAccess);
             } else {
                 if ($repository->getAccess() != $repoAccess) {
                     $this->systemEventManager->createEvent('GIT_REPO_ACCESS', $repoId . SystemEvent::PARAMETER_SEPARATOR . $repoAccess, SystemEvent::PRIORITY_HIGH);
                     $c->addInfo($this->getText('actions_repo_access'));
                 }
             }
         }
         if (strlen($repoDescription) > 1024) {
             $c->addError($this->getText('actions_long_description'));
         } elseif (!empty($repoDescription)) {
             $repository->setDescription($repoDescription);
         }
     } catch (GitDaoException $e) {
         $c->addError($this->getText('actions_repo_not_found'));
         $c->redirect('/plugins/git/?group_id=' . $projectId);
         return false;
     } catch (GitRepositoryException $e1) {
         die('GitRepositoryException');
         $c->addError($e1->getMessage());
         return false;
     }
     try {
         $repository->save();
     } catch (GitDaoException $e) {
         $c->addError($e->getMessage());
         $c->redirect('/plugins/git/index.php/' . $projectId . '/view/' . $repoId . '/');
         return false;
     }
     $c->addInfo($this->getText('actions_save_repo_process'));
     $c->redirect('/plugins/git/index.php/' . $projectId . '/view/' . $repoId . '/');
     return;
 }
开发者ID:nickl-,项目名称:tuleap,代码行数:59,代码来源:GitActions.class.php

示例5: 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

示例6: queueRepositoryRestore

 public function queueRepositoryRestore(GitRepository $repository)
 {
     if ($repository->getBackend() instanceof Git_Backend_Gitolite) {
         $this->system_event_manager->createEvent(SystemEvent_GIT_REPO_RESTORE::NAME, $repository->getId(), SystemEvent::PRIORITY_MEDIUM, SystemEvent::OWNER_APP);
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:SystemEventManager.class.php

示例7: isNamespaceValid

 private function isNamespaceValid(GitRepository $repository, $namespace)
 {
     if ($namespace) {
         $ns_chunk = explode('/', $namespace);
         foreach ($ns_chunk as $chunk) {
             //TODO use creator
             if (!$repository->getBackend()->isNameValid($chunk)) {
                 throw new Exception($GLOBALS['Language']->getText('plugin_git', 'fork_repository_invalid_namespace'));
             }
         }
     }
     return true;
 }
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:13,代码来源:GitRepositoryManager.class.php


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