PEAR namespace collisions ("Cache")

dmiric - October 4, 2008 - 20:08
Project:Cache Router
Version:6.x-1.0-beta8
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed
Description

Hello,

Thank you for making this module it seems to be very good. Only its not working for me for some reason.

Here are the errors I get :

Warning: Cache::include_once(Cache/Container/cache.php) [function.Cache-include-once]: failed to open stream: No such file or directory in D:\xampp\php\PEAR\Cache.php on line 135

Warning: Cache::include_once() [function.include]: Failed opening 'Cache/Container/cache.php' for inclusion (include_path='.;D:\xampp\php\pear\') in D:\xampp\php\PEAR\Cache.php on line 135

Fatal error: Class 'Cache_Container_cache' not found in D:\xampp\php\PEAR\Cache.php on line 136

The issue seems to be in "include_once(Cache/Container/cache.php)" part. That file does not exist in that directory. I even tried to copy 2 different cache.php files there but I just get errors that some functions cant be re declared.

Do I have different version of PEAR ?

Please help I would really like to make this module work.

PS I followed the installation instructions and patched files since I'm working on drupal 5.7

#1

ddoyle - November 30, 2008 - 17:40
Version:5.x-1.0-beta4» 6.x-1.0-beta8
Priority:normal» critical
Status:active» postponed (maintainer needs more info)

I too have this problem, If anyone knows how to fix it please let me know. I'm using XAMPP to develop my drupal 6.6 based website.

#2

slantview - December 4, 2008 - 21:08

I don't have a windows box to test this on. It seams that you have a PEAR class called Cache when what it is really looking for is a custom class called "Cache" in the cacherouter directory.

I will try to get this into the queue and test on windows. The only work-around I can suggest is opening up CacheRouter.php and changing line #2 to

<?php
require './Cache.php';

see if that helps.

Best,

Steve

#3

ddoyle - December 5, 2008 - 08:37

that didnt help

Warning: require(./Cache.php) [function.require]: failed to open stream: No such file or directory in E:\Webserver\xampp\htdocs\drupal6\sites\all\modules\cacherouter\CacheRouter.php on line 2

Fatal error: require() [function.require]: Failed opening required './Cache.php' (include_path='.;E:\Webserver\xampp\php\pear\') in E:\Webserver\xampp\htdocs\drupal6\sites\all\modules\cacherouter\CacheRouter.php on line 2

#4

AutoDMC - January 2, 2009 - 23:26

I had this exact same problem, but I was able to get it to work by editing CacheRouter.php and putting in a full path to the correct include file, starting from root:

require '/home/www/OMG_PATH/LOL/sites/all/modules/cacherouter/Cache.php';

It's exactly what you said, my host is desparatly attempting to use PEAR's cache instead of the local cache.

I'm not a Drupal Coding Pro, but would it be too hard to change the internal library name, so you're including "CacheRouter_Cache.php" as the library file? This would solve the PEAR conflict...

#5

dbeall - February 8, 2009 - 22:37

I don't use the local wamp server much cause it's so slow.
I really would like to be able to make use of this mod on a live site or 2...
Every time i tried it over the last few months, has the error

#6

gagagaga - February 18, 2009 - 00:35

I had this exact same problem on a xampp server

#7

tisoft_media - February 19, 2009 - 20:22

I had the same problem. Filling in the complete path in the require solved it for me, too.

#8

davidwhthomas - April 25, 2009 - 08:30

I had the same error for a XAMPP based project on Windows Server 2003

I applied a more generic fix to CacheRouter.php

require dirname(__FILE__).'/Cache.php';

This avoids the namespace collision with the PEAR class.

#9

slantview - September 3, 2009 - 11:33
Title:PEAR problem» PEAR namespace collisions ("Cache")
Status:postponed (maintainer needs more info)» fixed

Fixed in all branches. Thanks!

#10

System Message - September 17, 2009 - 11:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.