[wp-trac] [WordPress Trac] #20499: Memcached plugin version 2.0.2 does not work with single site installation
WordPress Trac
wp-trac at lists.automattic.com
Sat Apr 21 04:14:11 UTC 2012
#20499: Memcached plugin version 2.0.2 does not work with single site installation
--------------------------+------------------------------
Reporter: toddlahman | Owner: toddlahman
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache | Version: 3.3.1
Severity: major | Resolution:
Keywords: has-patch |
--------------------------+------------------------------
Comment (by toddlahman):
This also applies to Memcached plugin version 2.0.1. The fix for 2.0.1 is
below.
Original code:
{{{
global $blog_id, $table_prefix;
$this->global_prefix = ( is_multisite() ||
defined('CUSTOM_USER_TABLE') && defined('CUSTOM_USER_META_TABLE') ) ? '' :
$table_prefix;
$this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix )
. ':';
}}}
Code that allows it to also work on single site installations:
{{{
global $blog_id, $table_prefix;
$this->global_prefix = '';
$this->blog_prefix = '';
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
$this->global_prefix = ( is_multisite() ||
defined('CUSTOM_USER_TABLE') && defined('CUSTOM_USER_META_TABLE') ) ? '' :
$table_prefix;
$this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix )
. ':';
} else {
$this->global_prefix = $table_prefix;
$this->blog_prefix = $blog_id;
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20499#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list