In the memcache engine, at line 199, the memcache object is instanciated in the old php4 way with reference operator & as follow :

$this->memcache = & new Memcache;

This produce a php warning on php 5.2, as a notice I think, which prevent memcache to save the current page into the cache system.
The solution consists in removing the reference operator, since in php5, the new operator already return a reference. I will soon provide a patch modifying the deprecated instruction the following way :

$this->memcache = new Memcache;

Comments

raphael waeselynck’s picture

As promised, here is the patch modifying the deprecated instruction.
Please let me know if anything does not work as it should.

JirkaRybka’s picture

Question is, whether it works on PHP4. Drupal 6 supports PHP4 as well.

raphael waeselynck’s picture

Okay, let me explain it more accurately. The problem occurs with another module using memcache : authcache.
authcache does not cache a page if it raises any warning.
@JirkaRybka: do you think the following is compatible with both PHP4 & PHP5?

$memcache = new Memcache;
$this->memcache = & $memcache;
raphael waeselynck’s picture

here is a new patch based upon my previous proposition

sdelbosc’s picture

Status: Active » Needs review
andypost’s picture

can anyone test this with PHP 4? I'm going to commit this into 4 and 5 branches.

Drupal 7 require PHP 5.2.4 so commit #1 http://drupal.org/cvs?commit=443908

oranjer’s picture

subscribe