Closed (fixed)
Project:
Cache Router
Version:
6.x-1.0-beta8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2009 at 10:22 UTC
Updated:
17 Sep 2009 at 07:00 UTC
I modified settings.php according to the instructions and copied the files. I got immediatly this error:
warning: Missing argument 1 for dbCache::flush(), called in /home/controlc/www/sites/all/modules/cacherouter/CacheRouter.php on line 57 and defined in /home/controlc/www/sites/all/modules/cacherouter/engines/db.php on line 83.
warning: Missing argument 1 for dbCache::flush(), called in /home/controlc/www/sites/all/modules/cacherouter/CacheRouter.php on line 57 and defined in /home/controlc/www/sites/all/modules/cacherouter/engines/db.php on line 83.
Comments
Comment #1
jvieille commentedIn addition, it is impossible to remove it.
If I remove the files, the site is no longer accessible.
Comment #2
jvieille commentedSome more explanations...
I installed the module and added the following to the settings.php for the "db" mode:
$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
'default' => array(
'engine' => 'db',
'server' => array(),
'shared' => TRUE,
'prefix' => '',
'path' => 'sites/default/files/filecache',
'static' => FALSE,
'fast_cache' => TRUE,
),
);
When going to the module list page, I get the following error:
"warning: Missing argument 1 for dbCache::flush(), called in /home/controlc/www/sites/all/modules/cacherouter/CacheRouter.php on line 57 and defined in /home/controlc/www/sites/all/modules/cacherouter/engines/db.php on line 83.
warning: Missing argument 1 for dbCache::flush(), called in /home/controlc/www/sites/all/modules/cacherouter/CacheRouter.php on line 57 and defined in /home/controlc/www/sites/all/modules/cacherouter/engines/db.php on line 83."
The other pages are OK
Then I tried the "file" mode and got this error:
* warning: fopen() expects parameter 1 to be string, object given in /home/controlc/www/sites/all/modules/cacherouter/engines/file.php on line 113.
* warning: fopen() expects parameter 1 to be string, object given in /home/controlc/www/sites/all/modules/cacherouter/engines/file.php on line 113.
What would prevent these to modes from functionning?
Comment #3
ibandyop commentedsubscribing - exact same issue - drupal 6 with devel installed - config menu does not show up on navigator - no setup menus for menu
Comment #4
mwolfe38 commentedThere is a pretty easy fix to this, unfortunately I'm at work so I don't have time to create and submit a patch.
In the file cacherouter/engines/file.php There is a foreach loop over some files returned from a call to file_scan_directory
(near line 112). Each element in the array
is not a filename though, its an object which has a filename variable in it, so inside of that loop
change the fopen call from
fopen($file, 'w')
to
fopen($file->filename, 'w')
Also, there is an unlink call 2 lines below that which tries to unlink the file the same way, change
$file
to
$file->filename
There is an else statement right after the loop which works with a $file variable as well, this should NOT need to be changed though (I mistakenly changed that as well at first but got other errors).
Comment #5
PeteS commentedThat seems to have worked for me, thanks.
Comment #6
erdubya commentedAfter applying the changes to the file specified above, still having the same problem.
Comment #7
ibandyop commentedI made the changes described in #4., Need a PEAR file called cache_page.php which I cannot locate.
Searched PEAR with no success. http://pear.php.net/search.php?q=cache_page.php&in=packages
Exact error:
Comment #8
jason ruyle commentedPulling this message, it ended up not working.
It works on my /sites/default, but not my /sites/www.site.com
Comment #9
ludovicofischer commented#4: the change you proposed to engines/file.php seems to have already landed in CVS some time ago.
#7: it is a separate issue and you do not need the PEAR file. What's happening is that php is trying to include the PEAR file instead of the Cache.php file included with cacherouter. On line 8 of CacheRouter.php, replace
require 'Cache.php' with
require dirname(__FILE__) .'/Cache.php
This has also been fixed in CVS.
Marking as patch (to be ported).
Comment #10
ludovicofischer commentedIf no one objects, I'll mark as fixed, as the code is both in HEAD an 6-1 BRANCH.
Comment #12
glowkeeper commentedI've just installed cacherouter on a drupal-6.11 install, and I'm getting this very same issue.
Comment #13
glowkeeper commentedI should say that I'm on the 6.x-1.0-beta8 release, and I'm still getting the issue after upgrading to 6.12
Comment #14
Jorge-2 commentedMe too:
I should say that I'm on the 6.x-1.0-beta8 release, and I'm still getting the issue after upgrading to 6.12
Comment #15
najibx commentedyeah experiencing similar errors.
I have multisite on shared hosting, and set my 'path' => 'sites/mysite_here.com/files/filecache',
with 'engine' => 'file',
received bunch of red errors :
warning: fopen() expects parameter 1 to be string, object given in /home/fff/public_html/drupal6/sites/all/modules/cacherouter/engines/file.php on line 113.
warning: fopen() expects parameter 1 to be string, object given in /home/fff/public_html/drupal6/sites/all/modules/cacherouter/engines/file.php on line 113.
warning: fopen() expects parameter 1 to be string, object given in /home/fff/public_html/drupal6/sites/all/modules/cacherouter/engines/file.php on line 113.
warning: fopen() expects parameter 1 to be string, object given in
then with 'engine' => 'db' :
warning: Missing argument 1 for dbCache::flush(), called in /home/fff/public_html/drupal6/sites/all/modules/cacherouter/CacheRouter.php on line 57 and defined in /home/fff/public_html/drupal6/sites/all/modules/cacherouter/engines/db.php on line 83.
Comment #16
iLLin commentedThis patch will fix you.
http://drupal.org/node/493198
Comment #17
najibx commentedyes. tq
Comment #18
slantview commentedFixed in latest commit (using patch from #493198).
New release forthcoming!