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

jvieille - January 3, 2009 - 21:43
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.

#2

jvieille - January 6, 2009 - 13:59
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?

#3

ibandyop - January 7, 2009 - 22:57

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

#4

mwolfe38 - January 14, 2009 - 18:47

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

PeteS - January 16, 2009 - 15:00

That seems to have worked for me, thanks.

#6

erdubya - January 22, 2009 - 16:20

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

#7

ibandyop - January 23, 2009 - 02:45

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

Jason Ruyle - January 27, 2009 - 01:28

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

#9

ludovicofischer - April 4, 2009 - 08:25
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).

#10

ludovicofischer - April 7, 2009 - 02:31
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.

#11

System Message - April 21, 2009 - 02:40
Status:fixed» closed

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

#12

glowkeeper - May 18, 2009 - 19:14
Status:closed» needs review

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

#13

glowkeeper - May 18, 2009 - 20:12

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

Jorge - June 23, 2009 - 22:32

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

najibx - June 30, 2009 - 06:03

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

iLLin - July 8, 2009 - 01:50

This patch will fix you.

http://drupal.org/node/493198

#17

najibx - July 8, 2009 - 04:10

yes. tq

#18

slantview - September 3, 2009 - 06:54
Status:needs review» fixed

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

New release forthcoming!

#19

System Message - September 17, 2009 - 07:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.