NYCPHP Meetup

NYPHP.org

[nycphp-talk] PEAR DB_Cache: is this a bug?

David Mintz dmintz at davidmintz.org
Thu Feb 5 16:33:48 EST 2004


On Thu, 5 Feb 2004, Ophir Prusak wrote:
>
> I never used pear's cache libs before, but have been thinking of using
> something like it.
> I just checked your code on my machine and am getting the same results:
> http://www.stationplay.com/dev/cache_test.php
>
> Seems like a bug to me.
>
> I'm curious to know what other similar solutions you've looked at.
> I saw PEAR has a cache lite as well.

I might have a look. Thanks.

I guess I should have mentioned that I ran my code with PHP 4.3.4/Win2K
and 4.3.2/Linux and Mysql 4.0.something, same results. I did this to lines
325-338 and the problem apparently goes away (not thoroughly tested):

   if ($rownum === null) {
//           $this->cursor++;
    } else {
    	die ("If you pass us a \$rownum we go into an infinite loop.");
//            $this->cursor = $rownum;
        }

//  if ($rownum < sizeof($this->rows)) {
    if ($this->cursor < sizeof($this->rows)) {
//        $row = $this->rows[$this->cursor];
        $row = $this->rows[$this->cursor++];
    } else {
        return false;
    }

//------------------------------


---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list