本文整理汇总了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);
}
示例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());
}
}