Currently in D7 includes/cache.inc the interface DrupalCacheInterface has the following declaration:
function set($cid, $data, $expire = CACHE_PERMANENT);

Currently in memcache.inc:
function set($cid, $data, $expire = CACHE_PERMANENT, array $headers = NULL) {

Most of the time this works well for us but sometimes we see PHP errors:
PHP Fatal error: Declaration of MemCacheDrupal::set() must be compatible with that of DrupalCacheInterface::set() in /var/www/preview/sites/all/modules/contrib/memcache/memcache.inc on line 14

Comes and goes, cant really reproduce.

But since headers doesnt appear in core, nor does it seem to be used in memcache otherwise maybe it could be removed.

Comments

markpavlitski’s picture

Status: Active » Needs review
StatusFileSize
new809 bytes

I can't find anywhere that the headers item is used and test cases seem to be unaffected by removing it.

Attached patch removes the $cache->headers item and brings the set() in line with the interface.

markpavlitski’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Rok Žlender’s picture

Status: Needs review » Reviewed & tested by the community

I agree it should follow the interface it implements.

jeremy’s picture

Status: Reviewed & tested by the community » Fixed

Correct, this is a lingering parameter from Drupal 6.x (and earlier) and should be removed:
http://api.drupal.org/api/drupal/includes!cache.inc/function/cache_set/7

Thanks for the patch and review! Committed:
http://drupalcode.org/project/memcache.git/commitdiff/321f39b

Status: Fixed » Closed (fixed)

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