Patch for making session-memcache-db.inc work if memcache is not installed

DamienMcKenna - September 14, 2008 - 02:44
Project:Memcache API and Integration
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

The following patch allows the session-memcache-db.inc file to still work, and defer to db, if memcache is not actually running.

Index: sites/all/modules/memcache/session-memcache-db.inc
===================================================================
--- sites/all/modules/memcache/session-memcache-db.inc (revision 429)
+++ sites/all/modules/memcache/session-memcache-db.inc (working copy)
@@ -29,7 +29,8 @@
   }

   // If user session is in memcache, use it, otherwise load from db.
-  $user = dmemcache_get($key, 'session');
+  if(function_exists('dmemcache_get'))
+    $user = dmemcache_get($key, 'session');
   if(!$user) {
   $user = db_fetch_object(db_query("SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = '%s'", $key));
   }

#1

Jeremy - October 30, 2008 - 19:36
Status:needs review» needs work

There does not seem to be a session-memcache-db.inc, so your patch can't apply... Marking as code needs work.

#2

DamienMcKenna - December 18, 2008 - 16:19
Version:5.x-1.8» 5.x-1.x-dev

Updated to note that the session-memcache-db.inc file is only in CVS right now.

 
 

Drupal is a registered trademark of Dries Buytaert.