Re: cvs: pear /Log/Log sql.php
| From: | Jon Wood | Date: | Sat, 30 Nov 2002 22:38:52 +0000 |
| Subject: | Re: cvs: pear /Log/Log sql.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-7703@lists.php.net to get a copy of this message | ||
Should this code actually die, or just return an error... I don't think
there are many people who want their sites die'ing around the place.
Jon
On Sat, 2002-11-30 at 21:52, Jon Parise wrote:
> jon Sat Nov 30 16:52:53 2002 EDT
>
> Modified files:
> /pear/Log/Log sql.php
> Log:
> Die with an error message if the log insertion fails.
>
> Bug: 20733
>
>
> Index: pear/Log/Log/sql.php
> diff -u pear/Log/Log/sql.php:1.12 pear/Log/Log/sql.php:1.13
> --- pear/Log/Log/sql.php:1.12 Thu Nov 28 12:08:20 2002
> +++ pear/Log/Log/sql.php Sat Nov 30 16:52:53 2002
> @@ -1,5 +1,5 @@
> <?php
> -// $Id: sql.php,v 1.12 2002/11/28 17:08:20 jon Exp $
> +// $Id: sql.php,v 1.13 2002/11/30 21:52:53 jon Exp $
> // $Horde: horde/lib/Log/sql.php,v 1.12 2000/08/16 20:27:34 chuck Exp $
>
> require_once 'DB.php';
> @@ -20,7 +20,7 @@
> * );
> *
> * @author Jon Parise <jon@php.net>
> - * @version $Revision: 1.12 $
> + * @version $Revision: 1.13 $
> * @since Horde 1.3
> * @package Log
> */
> @@ -142,7 +142,10 @@
> $this->_table, $this->_db->quote($this->_ident),
> $priority, $this->_db->quote($message));
>
> - $this->_db->query($q);
> + $result = $this->_db->query($q);
> + if (DB::isError($result)) {
> + die($result->getMessage());
> + }
>
> $this->notifyAll(array('priority' => $priority, 'message'
> => $message));
> }
>
>
>
> --
> PEAR CVS Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>