cvs: pearweb /include/bugs pear-bugs-utils.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Thu, 10 Apr 2008 18:46:11 +0000 |
| Subject: | cvs: pearweb /include/bugs pear-bugs-utils.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7465@lists.php.net to get a copy of this message | ||
dufuz Thu Apr 10 18:46:11 2008 UTC
Modified files:
/pearweb/include/bugs pear-bugs-utils.php
Log:
Moved getMaintainers from Damblan_Bugs
http://cvs.php.net/viewvc.cgi/pearweb/include/bugs/pear-bugs-utils.php?r1=1.5&r2=1.6&diff_format=u
Index: pearweb/include/bugs/pear-bugs-utils.php
diff -u pearweb/include/bugs/pear-bugs-utils.php:1.5 pearweb/include/bugs/pear-bugs-utils.php:1.6
--- pearweb/include/bugs/pear-bugs-utils.php:1.5 Mon Apr 7 19:23:03 2008
+++ pearweb/include/bugs/pear-bugs-utils.php Thu Apr 10 18:46:11 2008
@@ -141,7 +141,6 @@
static function sendPatchEmail($patch)
{
require_once 'Damblan/Mailer.php';
- require_once 'Damblan/Bugs.php';
$name = urlencode($patch['patch']);
$id = $patch['bug_id'];
$host = 'http://' . PEAR_CHANNELNAME;
@@ -156,7 +155,7 @@
'packageUrl' => $host . '/bugs/bug.php?id=' . $id,
);
- $additionalHeaders['To'] =
Damblan_Bugs::getMaintainers($patch['package_name']);
+ $additionalHeaders['To'] =
self::getMaintainers($patch['package_name']);
$mailer = Damblan_Mailer::create('Patch_Added', $mailData);
$res = true;
if (!DEVBOX) {
@@ -164,4 +163,37 @@
}
return $res;
}
+
+ // {{{ public function getMaintainers
+ /**
+ * Get maintainers
+ *
+ * Get maintainers to inform of a trackback (the
+ * lead maintainers of a package).
+ *
+ * @since
+ * @access public
+ * @param boolean $activeOnly To get only active leads
+ * is set to false by default so there's
+ * no bc problems.
+ *
+ * @return array(string) The list of maintainer emails.
+ */
+ function getMaintainers ($id, $leadOnly = false, $activeOnly = true)
+ {
+ include_once 'pear-database-maintainer.php';
+ $maintainers = maintainer::get($id, $leadOnly, $activeOnly);
+ $res = array();
+
+ include_once 'pear-database-user.php';
+ foreach ($maintainers as $maintainer => $data) {
+ $tmpUser = user::info($maintainer, 'email');
+ if (!is_array($tmpUser) || !isset($tmpUser['email'])) {
+ continue;
+ }
+ $res[] = $tmpUser['email'];
+ }
+ return $res;
+ }
+ // }}}
}
\ No newline at end of file