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
Comment #1
markpavlitski commentedI 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.
Comment #2
markpavlitski commentedComment #3
Rok Žlender commentedI agree it should follow the interface it implements.
Comment #4
jeremy commentedCorrect, 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