Closed (duplicate)
Project:
Cache Router
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2008 at 18:40 UTC
Updated:
29 Aug 2008 at 19:36 UTC
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).
| Comment | File | Size | Author |
|---|---|---|---|
| cacherouter_db_001.patch | 881 bytes | btmash |
Comments
Comment #1
andypostAnother successful codecleanup
Comment #2
slantview commentedduplicate, fixed in latest cvs commits.