cvs: pearweb /public_html/bugs lstat.php
| From: | Daniel Convissor | Date: | Wed, 30 Jun 2004 06:02:02 +0000 |
| Subject: | cvs: pearweb /public_html/bugs lstat.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21296@lists.php.net to get a copy of this message | ||
danielc Wed Jun 30 02:02:02 2004 EDT
Modified files:
/pearweb/public_html/bugs lstat.php
Log:
* Line wrapping.
* Nesting.
* Use PEAR_ERROR_RETURN.
* echo 0 if error.
* Use ' instead of " to delimit literals in the query.
* Add page-level docblock.
http://cvs.php.net/diff.php/pearweb/public_html/bugs/lstat.php?r1=1.5&r2=1.6&ty=u
Index: pearweb/public_html/bugs/lstat.php
diff -u pearweb/public_html/bugs/lstat.php:1.5 pearweb/public_html/bugs/lstat.php:1.6
--- pearweb/public_html/bugs/lstat.php:1.5 Sun Jun 27 21:26:35 2004
+++ pearweb/public_html/bugs/lstat.php Wed Jun 30 02:02:01 2004
@@ -1,14 +1,36 @@
<?php
- require_once 'pear-database.php';
- $res = $dbh->getOne('SELECT count(bugdb.id) AS count FROM bugdb
- LEFT JOIN packages ON packages.name = bugdb.package_name
- WHERE bugdb.status IN ("Open", "Assigned",
- "Analyzed", "Critical",
"Verified")
- AND bugdb.bug_type = "Bug" AND packages.package_type =
"pear"');
- if (DB::isError($res)) {
- die;
- }
+/**
+ * Provide the number of open bugs to the IRC PEARbot
+ *
+ * This source file is subject to version 3.0 of the PHP license,
+ * that is bundled with this package in the file LICENSE, and is
+ * available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.
+ * If you did not receive a copy of the PHP license and are unable to
+ * obtain it through the world-wide-web, please send a note to
+ * license@php.net so we can mail you a copy immediately.
+ *
+ * @category pearweb
+ * @package Bugs
+ * @copyright Copyright (c) 1997-2004 The PHP Group
+ * @license http://www.php.net/license/3_0.txt
PHP License
+ * @version $Id: lstat.php,v 1.6 2004/06/30 06:02:01 danielc Exp $
+ */
+
+$dbh->pushErrorHandling(PEAR_ERROR_RETURN);
+
+$res =& $dbh->getOne("SELECT count(bugdb.id) AS count FROM bugdb
+ LEFT JOIN packages ON packages.name = bugdb.package_name
+ WHERE bugdb.status
+ IN ('Open', 'Assigned', 'Analyzed', 'Critical',
'Verified')
+ AND bugdb.bug_type = 'Bug'
+ AND packages.package_type = 'pear'");
+
+if (DB::isError($res)) {
+ echo 0;
+} else {
echo $res;
+}
?>