本文整理汇总了PHP中GitRepository::getPostReceiveShowRev方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getPostReceiveShowRev方法的具体用法?PHP GitRepository::getPostReceiveShowRev怎么用?PHP GitRepository::getPostReceiveShowRev使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getPostReceiveShowRev方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchMailHookConfig
/**
* Returns post-receive-email hook config in gitolite format
*
* @param Project $project
* @param GitRepository $repository
*/
public function fetchMailHookConfig($project, $repository)
{
$conf = '';
$conf .= ' config hooks.showrev = "';
$conf .= $repository->getPostReceiveShowRev($this->url_manager);
$conf .= '"';
$conf .= PHP_EOL;
if ($repository->getNotifiedMails() && count($repository->getNotifiedMails()) > 0) {
$conf .= ' config hooks.mailinglist = "' . implode(', ', $repository->getNotifiedMails()) . '"';
} else {
$conf .= ' config hooks.mailinglist = ""';
}
$conf .= PHP_EOL;
if ($repository->getMailPrefix() != GitRepository::DEFAULT_MAIL_PREFIX) {
$conf .= ' config hooks.emailprefix = "' . $repository->getMailPrefix() . '"';
$conf .= PHP_EOL;
}
return $conf;
}
示例2: setUpMailingHook
/**
* Configure mail output to link commit to gitweb
*
* @param GitRepository $repository
*/
public function setUpMailingHook($repository)
{
$path = $this->getGitRootPath() . $repository->getPath();
$show_rev = $repository->getPostReceiveShowRev($this->url_manager);
$this->getDriver()->setConfig($path, 'hooks.showrev', $show_rev);
}