Commit d4ee49ce authored by catch's avatar catch

Issue #1131140: remove some cruft from memcache_test.module, remove static...

Issue #1131140: remove some cruft from memcache_test.module, remove static caching of  in dmemcache_key.
parent 2fe64c55
......@@ -326,19 +326,14 @@ function dmemcache_object($bin = NULL, $flush = FALSE) {
}
function dmemcache_key($key, $bin = 'cache') {
static $prefix;
// memcache_key_prefix can be set in settings.php to support site namespaces
// in a multisite environment.
if (!isset($prefix)) {
$prefix = '';
if ($prefix = variable_get('memcache_key_prefix', '')) {
$prefix .= '-';
}
// When simpletest is running, emulate the simpletest database prefix here
// to avoid the child site setting cache entries in the parent site.
if (isset($GLOBALS['drupal_test_info']['test_run_id'])) {
$prefix .= $GLOBALS['drupal_test_info']['test_run_id'];
}
$prefix = '';
if ($prefix = variable_get('memcache_key_prefix', '')) {
$prefix .= '-';
}
// When simpletest is running, emulate the simpletest database prefix here
// to avoid the child site setting cache entries in the parent site.
if (isset($GLOBALS['drupal_test_info']['test_run_id'])) {
$prefix .= $GLOBALS['drupal_test_info']['test_run_id'];
}
$full_key = urlencode($prefix . $bin . '-' . $key);
......
......@@ -25,8 +25,6 @@ function memcache_test_menu() {
* Try to acquire a named lock and report the outcome.
*/
function memcache_test_lock_acquire() {
dmemcache_key(FALSE, FALSE, TRUE);
$GLOBALS['drupal_test_info']['test_run_id'] = arg(2);
if (lock_acquire('memcache_test_lock_acquire')) {
lock_release('memcache_test_lock_acquire');
return 'TRUE: Lock successfully acquired in memcache_test_lock_acquire()';
......@@ -40,8 +38,6 @@ function memcache_test_lock_acquire() {
* Try to acquire a specific lock, and then exit.
*/
function memcache_test_lock_exit() {
dmemcache_key(FALSE, FALSE, TRUE);
$GLOBALS['drupal_test_info']['test_run_id'] = arg(2);
if (lock_acquire('memcache_test_lock_exit', 900)) {
echo 'TRUE: Lock successfully acquired in memcache_test_lock_exit()';
// The shut-down function should release the lock.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment