cvs: pearweb /public_html/bugs/include functions.inc
| From: | Daniel Convissor | Date: | Wed, 30 Jun 2004 04:21:55 +0000 |
| Subject: | cvs: pearweb /public_html/bugs/include functions.inc | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21292@lists.php.net to get a copy of this message | ||
danielc Wed Jun 30 00:21:55 2004 EDT
Modified files:
/pearweb/public_html/bugs/include functions.inc
Log:
* Define $pseudo_pkgs in centralized place for use
throughout bug system.
http://cvs.php.net/diff.php/pearweb/public_html/bugs/include/functions.inc?r1=1.56&r2=1.57&ty=u
Index: pearweb/public_html/bugs/include/functions.inc
diff -u pearweb/public_html/bugs/include/functions.inc:1.56
pearweb/public_html/bugs/include/functions.inc:1.57
--- pearweb/public_html/bugs/include/functions.inc:1.56 Wed Jun 30 00:09:29 2004
+++ pearweb/public_html/bugs/include/functions.inc Wed Jun 30 00:21:55 2004
@@ -15,7 +15,7 @@
* @package Bugs
* @copyright Copyright (c) 1997-2004 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License
- * @version $Id: functions.inc,v 1.56 2004/06/30 04:09:29 danielc Exp $
+ * @version $Id: functions.inc,v 1.57 2004/06/30 04:21:55 danielc Exp $
*/
// used in mail_bug_updates(), below, and class for search results
@@ -60,6 +60,13 @@
'All' => 0
);
+// Items that need bug tracking but aren't real packages
+$pseudo_pkgs = array(
+ 'Web Site',
+ 'Documentation',
+ 'Bug System',
+ 'PEPr',
+);
/**
* Obfuscates email addresses to hinder spammer's spiders
@@ -821,12 +828,12 @@
*/
function package_exists($type)
{
- global $dbh;
+ global $dbh, $pseudo_pkgs;
if (empty($type)) {
return false;
}
- if (in_array($type, array('Web Site', 'Documentation', 'Bug
System', 'PEPr'))) {
+ if (in_array($type, $pseudo_pkgs)) {
return true;
}
$found = $dbh->getOne('SELECT count(*) FROM packages WHERE packages.name=' .
"'" . $type ."'");
@@ -971,21 +978,20 @@
*/
function show_bugs_menu($pkgname)
{
- global $dbh;
+ global $dbh, $pseudo_pkgs;
if (empty($pkgname)) {
return;
}
$pkgname = (array)$pkgname;
- $webpkgs = array('Web Site', 'Documentation', 'Bug System',
'PEPr');
$home = true;
foreach ($pkgname as $key => $value) {
if (!preg_match('/^[A-Za-z0-9_ ]+$/', $value)) {
return;
}
- if (in_array($value, $webpkgs)) {
+ if (in_array($value, $pseudo_pkgs)) {
$home = false;
$pkgname[$key] = strtr($value, ' ', '+');
}