Cache Router fails - No way to get it working
jvieille - January 3, 2009 - 10:22
| Project: | Cache Router |
| Version: | 6.x-1.0-beta8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
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.

#1
In addition, it is impossible to remove it.
If I remove the files, the site is no longer accessible.
#2
Some 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?
#3
subscribing - exact same issue - drupal 6 with devel installed - config menu does not show up on navigator - no setup menus for menu
#4
There 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).
#5
That seems to have worked for me, thanks.
#6
After applying the changes to the file specified above, still having the same problem.
#7
I 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:
Warning: include_once(Cache/Container/cache_page.php) [function.include-once]: failed to open stream: No such file or directory in /php/PEAR/Cache.php on line 136#8
Pulling this message, it ended up not working.
It works on my /sites/default, but not my /sites/www.site.com
#9
#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).
#10
If no one objects, I'll mark as fixed, as the code is both in HEAD an 6-1 BRANCH.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.
#12
I've just installed cacherouter on a drupal-6.11 install, and I'm getting this very same issue.
#13
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
#14
Me 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
#15
yeah 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.
#16
This patch will fix you.
http://drupal.org/node/493198
#17
yes. tq
#18
Fixed in latest commit (using patch from #493198).
New release forthcoming!
#19
Automatically closed -- issue fixed for 2 weeks with no activity.