Hi,

When I tried to run the new version of the cache router, I got a fatal error:

[02-Jun-2008 14:26:57] PHP Fatal error:  Cannot redeclare dbCache::flush() in /path/to/drupal/sites/all/modules/cacherouter/engines/db.php on line 88

And when I looked at the code, I saw:

  function flush() {
    $this->content = array();
    db_query("DELETE FROM {". $this->name ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time()); 
  }

  function flush($flush = NULL) {
    $this->content = array();
    db_query("DELETE FROM {". $this->name ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, $flush); 
  }

To correct the issue, I combined the two so you have:

  function flush($flush = NULL) {
    if (is_null($flush)) {
      $flush = time();
    }
    $this->content = array();
    db_query("DELETE FROM {". $this->name ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, $flush); 
  }

I'm attaching a patch that I generated from a subversion diff (its not a cvs diff and I hope its easy enough to still patch...hence attaching the code above).

CommentFileSizeAuthor
cacherouter_db_001.patch881 bytesbtmash

Comments

andypost’s picture

Status: Active » Reviewed & tested by the community

Another successful codecleanup

slantview’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

duplicate, fixed in latest cvs commits.