本文整理汇总了PHP中GitRepository::getNotifiedMails方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getNotifiedMails方法的具体用法?PHP GitRepository::getNotifiedMails怎么用?PHP GitRepository::getNotifiedMails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getNotifiedMails方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: _listOfMails
/**
* LIST OF MAILS TO NOTIFY
*/
protected function _listOfMails()
{
$r = new GitRepository();
$r->setId($this->repoId);
$r->load();
$mails = $r->getNotifiedMails();
?>
<h3><?php
echo $this->getText('notified_mails_title');
?>
</h3>
<?php
if (!empty($mails)) {
?>
<form id="add_user_form" action="/plugins/git/" method="POST">
<input type="hidden" id="action" name="action" value="remove_mail" />
<input type="hidden" id="group_id" name="group_id" value="<?php
echo $this->groupId;
?>
" />
<input type="hidden" id="repo_id" name="repo_id" value="<?php
echo $this->repoId;
?>
" />
<table>
<?php
$i = 0;
foreach ($mails as $mail) {
echo '<tr class="' . html_get_alt_row_color(++$i) . '">';
echo '<td>' . $mail . '</td>';
echo '<td>';
echo '<input type="checkbox" name="mail[]" value="' . $this->HTMLPurifier->purify($mail) . '" />';
echo '</a>';
echo '</td>';
echo '</tr>';
}
?>
</table>
<input type="submit" value="<?php
echo $GLOBALS['Language']->getText('global', 'btn_delete');
?>
" />
</form>
<?php
} else {
?>
<h4><?php
echo $this->getText('add_mail_existing');
?>
</h4>
<?php
}
}
示例3: changeRepositoryMailingList
/**
* Update list of people notified by post-receive-email hook
*
* @param GitRepository $repository
*/
public function changeRepositoryMailingList($repository)
{
$path = $this->getGitRootPath() . $repository->getPath();
$this->getDriver()->setConfig($path, 'hooks.mailinglist', implode(',', $repository->getNotifiedMails()));
$this->setUpMailingHook($repository);
return true;
}
示例4: sendMail
/**
* @return bool
*/
private function sendMail(GitRepository $repository, MailBuilder $mail_builder, $oldrev, $newrev, $refname)
{
$mail_raw_output = array();
exec('/usr/share/codendi/plugins/git/hooks/post-receive-email ' . escapeshellarg($oldrev) . ' ' . escapeshellarg($newrev) . ' ' . escapeshellarg($refname), $mail_raw_output);
$subject = isset($mail_raw_output[0]) ? $mail_raw_output[0] : self::DEFAULT_MAIL_SUBJECT;
$mail_enhancer = new MailEnhancer();
$this->addAdditionalMailHeaders($mail_enhancer, $mail_raw_output);
$this->setFrom($mail_enhancer);
$body = $this->createMailBody($mail_raw_output);
$access_link = $repository->getDiffLink($this->repository_url_manager, $newrev);
$notification = new Notification($repository->getNotifiedMails(), $subject, '', $body, $access_link, 'Git');
return $mail_builder->buildAndSendEmail($repository->getProject(), $notification, $mail_enhancer);
}