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


PHP GitRepository::getFullPath方法代码示例

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


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

示例1: exportGitBranches

 protected function exportGitBranches(Git_RemoteServer_GerritServer $gerrit_server, $gerrit_project, GitRepository $repository)
 {
     $gerrit_project_url = $gerrit_server->getCloneSSHUrl($gerrit_project);
     $executor = new Git_Exec($repository->getFullPath(), $repository->getFullPath());
     $executor->exportBranchesAndTags($gerrit_project_url);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:ProjectCreator.class.php

示例2: backup

 /**
  * Backup gitolite repository
  *
  * @param String $path               The repository path
  * @param String $backup_directory The repository backup directory path
  * @param String $repositoryName
  *
  */
 public function backup(GitRepository $repository, $backup_directory)
 {
     if (!is_readable($repository->getFullPath())) {
         throw new GitDriverErrorException('Gitolite backup: Empty path or permission denied ' . $repository->getFullPath());
     }
     if (!is_writable($backup_directory)) {
         throw new GitDriverErrorException('Gitolite backup: Empty backup path or permission denied ' . $backup_directory);
     }
     $backup_path = $this->getBackupPath($repository, $backup_directory);
     $target_directory = dirname($backup_path);
     if (!is_dir($target_directory)) {
         if (!mkdir($target_directory, 0700, true)) {
             throw new GitDriverErrorException('Unable to create git backup directory: ' . $target_directory);
         }
     }
     try {
         $exec = new System_Command();
         $command = 'tar cvzf ' . escapeshellarg($backup_path) . ' ' . escapeshellarg($repository->getFullPath());
         $exec->exec($command);
         $command = 'chmod 644 ' . escapeshellarg($backup_path);
         $exec->exec($command);
         $this->logger->info('[Gitolite][Backup] Repository backup done in [' . $backup_path . ']');
     } catch (System_Command_CommandException $exception) {
         $this->logger->error('[Gitolite][Backup] Error when backuping repository in [' . $backup_path . '] error message : ' . $exception->getMessage());
         throw new GitDriverErrorException($exception->getMessage());
     }
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:35,代码来源:Git_GitoliteDriver.class.php


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