Re: cvs: pearweb /public_html/bugs lstat.php
| From: | Daniel Convissor | Date: | Fri, 25 Jun 2004 16:08:04 +0000 |
| Subject: | Re: cvs: pearweb /public_html/bugs lstat.php | ||
| References: | 1 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-2628@lists.php.net to get a copy of this message | ||
Hi Toby:
On Fri, Jun 25, 2004 at 03:48:36PM -0000, Tobias Schlitt wrote:
> Added files:
> /pearweb/public_html/bugs lstat.php
I have been thinking that it would be a good idea if the bug system were
able to be a standalone elemement/package.
Would you mind terribly moving this file to the public_html dir, please?
> <?php
>
> require_once 'pear-database.php';
This is already include automatially by pearweb/include/pear-prepend.php
> $res = $dbh->getOne('SELECT count( id ) AS count FROM bugdb WHERE STATUS =
> "Open"');
> if (DB::isError($res)) {
> die;
> }
There's a default error handler. So, if an error exists, you won't even
get to your if statement. Put the following line above the getOne() call:
$dbh->pushErrorHandling(PEAR_ERROR_RETURN);
And it'd be a good idea to return 0 in the event of errors instead of just
dying. That way, the page returns _something_, which will likely keep
pearbot happy. If you indeed want to die, then you don't need the if and
you can just change the error handling constant to PEAR_ERROR_DIE.
Man, Zend IDE's nesting sucks...
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409