Re: cvs: pear /Cache/Container db.php

From: Date: Sun, 08 Dec 2002 22:28:26 +0000
Subject: Re: cvs: pear /Cache/Container db.php
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11439@lists.php.net to get a copy of this message
Hi On Sun, 2002-12-08 at 13:46, Lorenzo Alberton wrote: > quipo Sun Dec 8 07:46:13 2002 EDT > > Modified files: > /pear/Cache/Container db.php > Log: > added some error checking routines to garbage_collector GarabgeCollector() is called after script end with the "fake" deconstructor method from PEAR. What's the idea in providing errors after the main script (and output) is gone? Mabye I just miss something... (the error-routines per se are not worrying me, i'm just wondering :) ) chregu > > > Index: pear/Cache/Container/db.php > diff -u pear/Cache/Container/db.php:1.3 pear/Cache/Container/db.php:1.4 > --- pear/Cache/Container/db.php:1.3 Fri Nov 8 10:24:49 2002 > +++ pear/Cache/Container/db.php Sun Dec 8 07:46:13 2002 > @@ -17,7 +17,7 @@ > // | Chuck Hagenbuch <chuck@horde.org> | > // +----------------------------------------------------------------------+ > // > -// $Id: db.php,v 1.3 2002/11/08 15:24:49 chregu Exp $ > +// $Id: db.php,v 1.4 2002/12/08 12:46:13 quipo Exp $ > > require_once 'DB.php'; > require_once 'Cache/Container.php'; > @@ -52,7 +52,7 @@ > * ) > * > * @author Sebastian Bergmann <sb@sebastian-bergmann.de> > -* @version $Id: db.php,v 1.3 2002/11/08 15:24:49 chregu Exp $ > +* @version $Id: db.php,v 1.4 2002/12/08 12:46:13 quipo Exp $ > * @package Cache > */ > class Cache_Container_db extends Cache_Container { > @@ -229,6 +229,10 @@ > $this->cache_table > ); > $cachesize = $this->db->GetOne($query); > + if (DB::isError($cachesize)) { > + return new Cache_Error('DB::query failed: ' . > DB::errorMessage($cachesize), __FILE__, __LINE__); > + } > + > //if cache is to big. > if ($cachesize > $this->highwater) > { > @@ -237,6 +241,10 @@ > $this->cache_table > ); > $res = $this->db->query($query); > + if (DB::isError($res)) { > + return new Cache_Error('DB::query failed: ' . > DB::errorMessage($res), __FILE__, __LINE__); > + } > + > $numrows = $this->db->numRows($res); > $keep_size = 0; > while ($keep_size < $this->lowwater && $numrows--) { -- christian stocker | bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB

« previous php.pear.dev (#11439) next »