Index: README.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/memcache/README.txt,v retrieving revision 1.11 diff -u -p -r1.11 README.txt --- README.txt 29 Jan 2008 23:43:34 -0000 1.11 +++ README.txt 29 May 2008 03:19:06 -0000 @@ -10,15 +10,12 @@ is important. 3. Put your site into offline mode. 4. Download and install the memcache module. 5. If you have previously been running the memcache module, run update.php. -6. Apply the DRUPAL-5-x-cache-serialize.patch from the patches folder that - comes with the module. Version specific, so use DRUPAL-5-6-cache-serialize.patch - if you are running Drupal 5.6. -7. Start at least one instance of memcached on your server. -8. Edit settings.php to configure the servers, clusters and bins that memcache +6. Start at least one instance of memcached on your server. +7. Edit settings.php to configure the servers, clusters and bins that memcache is supposed to use. -9. Edit settings.php to include either memcache.inc or memcache.db.inc. For +8. Edit settings.php to include either memcache.inc or memcache.db.inc. For example, $conf['cache_inc'] ='sites/all/modules/memcache/memcache.db.inc'; -10. Bring your site back online. +9. Bring your site back online. For instructions on 1 and 2 above, please see the INSTALLATION.txt file that comes with the memcache module download. @@ -125,44 +122,9 @@ $conf = array( 'memcache_key_prefix' => 'something_unique', ); -## PATCHES ## - -The DRUPAL-5-cache-serialize.patch must be applied to your Drupal installation -for this software to work. The patch depends on a column that needs to get added -to all of the existing cache tables for your site. This column has been -introduced in the DRUPAL-6 development branch so this patch is future-safe if -you ever upgrade to DRUPAL-6. To actually add the column to your database, you -need to either install the memcache.module, or, if it is already installed and -you are updating to this version, run update.php. Either installing the module -or running update.php will add the needed column, Uninstalling the module will -remove the column. - ## TROUBLESHOOTING ## PROBLEM: -Warning: require_once(a) [function.require-once]: failed to open stream: -No such file or directory in /includes/bootstrap.inc on line 853 - -SOLUTION: -This error occurs after you apply the DRUPAL-5-cache-serialize.patch because -the code in the patch now expects the cached variables to be unserialized -but they are still serialized in the cache. Clear the cache table: - -mysql> TRUNCATE cache; -Query OK, 0 rows affected (0.01 sec) - -PROBLEM: -Fatal error: Cannot use string offset as an array in includes/menu.inc on line 452 - -SOLUTION: -Similar to the error above, this occurs after applying the -DRUPAL-5-cache-serialize.patch due to the conflict between the existing -cached menu and what the patched code is expecting. Clear cache_menu: - -mysql> TRUNCATE cache_menu; -Query OK, 0 rows affected (0.33 sec) - -PROBLEM: Error: Failed to set key: Failed to set key: cache_page-...... Index: memcache.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/memcache/memcache.inc,v retrieving revision 1.27 diff -u -p -r1.27 memcache.inc --- memcache.inc 29 Jan 2008 23:43:34 -0000 1.27 +++ memcache.inc 29 May 2008 03:19:08 -0000 @@ -43,7 +43,7 @@ function cache_get($key, $table = 'cache * It allows us to do a cache_set and not write to the database, but only * to memcache. */ -function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) { +function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) { $time = time(); // Create new cache object. Index: memcache.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/memcache/memcache.info,v retrieving revision 1.2 diff -u -p -r1.2 memcache.info --- memcache.info 18 Jun 2007 23:50:54 -0000 1.2 +++ memcache.info 29 May 2008 03:19:08 -0000 @@ -1,4 +1,7 @@ ; $Id: memcache.info,v 1.2 2007/06/18 23:50:54 dww Exp $ name = Memcache description = High performance integration with memcache. +version = VERSION +core = 6.x + Index: memcache_admin/memcache_admin.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/memcache/memcache_admin/memcache_admin.info,v retrieving revision 1.2 diff -u -p -r1.2 memcache_admin.info --- memcache_admin/memcache_admin.info 18 Jun 2007 22:53:49 -0000 1.2 +++ memcache_admin/memcache_admin.info 29 May 2008 03:19:08 -0000 @@ -1,4 +1,6 @@ ; $Id: memcache_admin.info,v 1.2 2007/06/18 22:53:49 dww Exp $ name = Memcache Admin description = Adds a User Interface to monitor the Memcache for this site. -dependencies = memcache \ No newline at end of file +dependencies[] = memcache +version = VERSION +core = 6.x Index: memcache_admin/memcache_admin.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/memcache/memcache_admin/memcache_admin.module,v retrieving revision 1.4 diff -u -p -r1.4 memcache_admin.module --- memcache_admin/memcache_admin.module 29 Jan 2008 22:50:25 -0000 1.4 +++ memcache_admin/memcache_admin.module 29 May 2008 03:19:09 -0000 @@ -1,68 +1,72 @@ 'admin/settings/memcache', - 'callback' => 'memcache_admin_stats', - 'title' => t('Memcache'), - 'type' => MENU_LOCAL_TASK, - 'access' => user_access('access memcache statistics'), - 'description' => t("View the statistics for this site's memcache and generate new settings."), - ); + $items['admin/settings/memcache'] = array( + 'title' => 'Memcache', + 'description' => "View the statistics for this site's memcache and generate new settings.", + 'page callback' => 'memcache_admin_stats', + 'access callback' => 'user_access', + 'access arguments' => array('access memcache statistics'), + 'type' => MENU_NORMAL_ITEM, + ); + + $memcache_servers = variable_get('memcache_servers', array()); + $clusters = array(); + foreach($memcache_servers as $server => $cluster) { + $clusters[$cluster]['servers'][] = $server; + $clusters[$cluster]['bin'] = _memcache_admin_get_bin_for_cluster($cluster); } - else { - $memache_servers = variable_get('memcache_servers', array()); - $clusters = array(); - foreach($memache_servers as $server => $cluster) { - $clusters[$cluster]['servers'][] = $server; - $clusters[$cluster]['bin'] = _memcache_admin_get_bin_for_cluster($cluster); - } - - $count = 0; - foreach($clusters as $cluster => $cluster_info) { - if ($cluster_info['bin']) { - - $items[] = array( - 'path' => 'admin/settings/memcache/' . $cluster, - 'type' => MENU_LOCAL_TASK, - 'callback' => 'memcache_admin_stats', - 'callback arguments' => array($cluster), - 'title' => $cluster, - 'access' => user_access('access memcache statistics'), - 'weight' => $count, - ); - - $count++; - } - } - + $count = 0; + foreach($clusters as $cluster => $custer_info) { + $items['admin/settings/memcache/'.$cluster] = array( + 'title' => $cluster, + 'page callback' => 'memcache_admin_stats', + 'page arguments' => array(3), + 'access arguments' => array('access memcache statistics'), + 'type' => $count == 0 ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, + 'weight' => $count, + 'tab parent' => 'admin/settings/memcache', + ); - if ($arg = arg(3)) { - $count = 0; - foreach(array('default', 'reset', 'malloc', 'maps', 'cachedump', 'slabs', 'items', 'sizes') as $type) { - $items[] = array( - 'path' => 'admin/settings/memcache/' . $arg . '/' . $type, - 'type' => $type == 'default' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, - 'callback' => 'memcache_admin_stats', - 'callback arguments' => array($arg, $type), - 'title' => $type, - 'access' => user_access('access memcache statistics'), - 'weight' => $count, - ); + $count++; + } - $count++; - } - } + $count = 0; + foreach(array('default', 'reset', 'malloc', 'maps', 'cachedump', 'slabs', 'items', 'sizes') as $type) { + $items['admin/settings/memcache/%memcache_admin_cluster_default/'.$type] = array( + 'title' => $type, + 'page callback' => 'memcache_admin_stats', + 'page arguments' => array(3, 4), + 'access arguments' => array('access memcache statistics'), + 'type' => $type == 'default' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, + 'weight' => $count, + ); + $count ++; } return $items; } +function memcache_admin_cluster_default_to_arg($arg, $map, $index) { + $memcache_servers = variable_get('memcache_servers', array()); + $cluster = current($memcache_servers); + + return !empty($arg) ? $arg : $cluster; +} + +function memcache_admin_theme() { + return array( + 'memcache_admin_stats_table' => array( + 'arguments' => array('server' => NULL, 'stats' => NULL), + ), + ); +} + + function memcache_admin_stats($cluster = NULL, $type = 'default') { $bin = _memcache_admin_get_bin_for_cluster($cluster); $output = t('Please select a cluster');