Exemplo n.º 1
0
 /**
  * Constructor.
  *
  * @param string       $sender    Sender of the iTip reply.
  * @param string       $recipient Recipient of the iTip reply.
  * @param MIME_Headers $headers   Reply headers.
  * @param MIME_Message $body      Reply body.
  */
 public function __construct($sender, $recipient, MIME_Headers $headers, MIME_Message $body)
 {
     $this->_sender = $sender;
     $this->_recipient = MIME::encodeAddress($recipient);
     $this->_headers = $headers;
     $this->_body = $body;
 }
Exemplo n.º 2
0
 function announce()
 {
     $module = $this->options['module'];
     if (!isset($this->notes)) {
         print "NOT announcing release, RELEASE_NOTES missing.\n";
         return;
     }
     if (!empty($this->options['noannounce'])) {
         print "NOT announcing release on freshmeat.net\n";
     } else {
         print "Announcing release on freshmeat.net\n";
         $fm = Horde_RPC::request('xmlrpc', 'http://freshmeat.net/xmlrpc/', 'login', array('username' => $this->options['fm']['user'], 'password' => $this->options['fm']['password']));
         if ($this->_fmVerify($fm)) {
             $fm = Horde_RPC::request('xmlrpc', 'http://freshmeat.net/xmlrpc/', 'publish_release', array('SID' => $fm['SID'], 'project_name' => $this->notes['fm']['project'], 'branch_name' => $this->notes['fm']['branch'], 'version' => $this->sourceVersionString, 'changes' => $this->notes['fm']['changes'], 'release_focus' => (int) $this->notes['fm']['focus'], 'url_changelog' => $this->oldVersion ? "http://cvs.horde.org/diff.php/{$module}/docs/CHANGES?r1={$this->oldChangelogVersion}&r2={$this->changelogVersion}&ty=h" : '', 'url_tgz' => "ftp://ftp.horde.org/pub/{$module}/{$this->tarballName}"));
             $this->_fmVerify($fm);
         }
     }
     $ml = $module;
     if ($ml == 'accounts' || $ml == 'forwards' || $ml == 'passwd' || $ml == 'vacation') {
         $ml = 'sork';
     }
     $to = "announce@lists.horde.org, {$ml}@lists.horde.org";
     if (!$this->latest) {
         $to .= ', i18n@lists.horde.org';
     }
     if (!empty($this->options['noannounce'])) {
         print "NOT announcing release on {$to}\n";
         return;
     }
     print "Announcing release to {$to}\n";
     // Building headers
     $subject = $this->notes['name'] . ' ' . $this->sourceVersionString;
     if ($this->latest) {
         $subject .= ' (final)';
     }
     $headers = array('From' => $this->options['ml']['from'], 'To' => $to, 'Subject' => $subject);
     // Building message text
     $body = $this->notes['ml']['changes'];
     if ($this->oldVersion) {
         $body .= "\n\n" . sprintf('The full list of changes (from version %s) can be viewed here:', $this->oldSourceVersionString) . "\n\n" . sprintf('http://cvs.horde.org/diff.php/%s/docs/CHANGES?r1=%s&r2=%s&ty=h', $module, $this->oldChangelogVersion, $this->changelogVersion);
     }
     $body .= "\n\n" . sprintf('The %s %s distribution is available from the following locations:', $this->notes['name'], $this->sourceVersionString) . "\n\n" . sprintf('    ftp://ftp.horde.org/pub/%s/%s', $module, $this->tarballName) . "\n" . sprintf('    http://ftp.horde.org/pub/%s/%s', $module, $this->tarballName);
     if ($this->makeDiff) {
         $body .= "\n\n" . sprintf('Patches against version %s are available at:', $this->oldSourceVersionString) . "\n\n" . sprintf('    ftp://ftp.horde.org/pub/%s/patches/%s.gz', $module, $this->patchName) . "\n" . sprintf('    http://ftp.horde.org/pub/%s/patches/%s.gz', $module, $this->patchName);
     }
     $body .= "\n\n" . 'Or, for quicker access, download from your nearest mirror:' . "\n\n" . '    http://www.horde.org/mirrors.php' . "\n\n" . 'MD5 sums for the packages are as follows:' . "\n\n" . '    ' . $this->tarballMD5[0] . "\n" . '    ' . $this->patchMD5[0] . "\n\n" . 'Have fun!' . "\n\n" . 'The Horde Team.';
     // Building and sending message
     $message =& new MIME_Message('lists.horde.org');
     $part =& new MIME_Part('text/plain', $body, 'iso-8859-1');
     $message->addPart($part);
     $headers = $message->encode($headers, 'iso-8859-1');
     $msg = $message->toString();
     if (substr($msg, -1) != "\n") {
         $msg .= "\n";
     }
     require_once 'Mail.php';
     $mailer =& Mail::factory($this->options['mailer']['type'], $this->options['mailer']['params']);
     $result = $mailer->send(MIME::encodeAddress($to), $headers, $msg);
     if (is_a($result, 'PEAR_Error')) {
         print $result->getMessage() . "\n";
     }
 }