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


PHP GitRepository::getNotifiedMails方法代码示例

本文整理汇总了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;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:25,代码来源:ProjectSerializer.class.php

示例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 
        }
    }
开发者ID:nterray,项目名称:tuleap,代码行数:56,代码来源:GitViews.class.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;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:GitBackend.class.php

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


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