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

jvieille’s picture

Title: Install fails » Cache Router Install fails - Get permanent error - Impossible to remove the module

In addition, it is impossible to remove it.
If I remove the files, the site is no longer accessible.

jvieille’s picture

Title: Cache Router Install fails - Get permanent error - Impossible to remove the module » Cache Router fails - No way to get it working

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?

ibandyop’s picture

subscribing - exact same issue - drupal 6 with devel installed - config menu does not show up on navigator - no setup menus for menu

mwolfe38’s picture

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).

PeteS’s picture

That seems to have worked for me, thanks.

erdubya’s picture

After applying the changes to the file specified above, still having the same problem.

ibandyop’s picture

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
jason ruyle’s picture

Pulling this message, it ended up not working.
It works on my /sites/default, but not my /sites/www.site.com

ludovicofischer’s picture

Status: Active » Patch (to be ported)

#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).

ludovicofischer’s picture

Status: Patch (to be ported) » Fixed

If no one objects, I'll mark as fixed, as the code is both in HEAD an 6-1 BRANCH.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

glowkeeper’s picture

Status: Closed (fixed) » Needs review

I've just installed cacherouter on a drupal-6.11 install, and I'm getting this very same issue.

glowkeeper’s picture

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

Jorge-2’s picture

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

najibx’s picture

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.

iLLin’s picture

This patch will fix you.

http://drupal.org/node/493198

najibx’s picture

yes. tq

slantview’s picture

Status: Needs review » Fixed

Fixed in latest commit (using patch from #493198).

New release forthcoming!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.