print "<li><a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache</a> installed</li>\n";
}
+$conf->xcache = function_exists( 'xcache_get' );
+if( $conf->xcache )
+ print "<li><a href=\"http://trac.lighttpd.net/xcache/\">XCache</a> installed</li>";
+
$conf->apc = function_exists('apc_fetch');
if ($conf->apc ) {
print "<li><a href=\"http://www.php.net/apc\">APC</a> installed</li>";
print "<li><a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> installed</li>\n";
}
-if( !$conf->turck && !$conf->eaccel && !$conf->apc ) {
+if( !( $conf->turck || $conf->eaccel || $conf->apc || $conf->xcache ) ) {
echo( '<li>Couldn\'t find <a href="http://turck-mmcache.sourceforge.net">Turck MMCache</a>,
- <a href="http://eaccelerator.sourceforge.net">eAccelerator</a>, or
- <a href="http://www.php.net/apc">APC</a>. Object caching functions cannot be used.</li>' );
+ <a href="http://eaccelerator.sourceforge.net">eAccelerator</a>,
+ <a href="http://www.php.net/apc">APC</a> or <a href="http://trac.lighttpd.net/xcache/">XCache</a>.
+ Object caching functions cannot be used.</li>' );
}
$conf->diff3 = false;
<p class="config-desc">
An admin can lock/delete pages, block users from editing, and do other maintenance tasks.<br />
A new account will be added only when creating a new wiki database.
- </p>
- <p class="config-desc">
+ <br /><br />
The password cannot be the same as the username.
</p>
aField( $conf, "Shm", "Turck MMCache", "radio", "turck" );
echo "</li>";
}
+ if( $conf->xcache ) {
+ echo( '<li>' );
+ aField( $conf, 'Shm', 'XCache', 'radio', 'xcache' );
+ echo( '</li>' );
+ }
if ( $conf->apc ) {
echo "<li>";
aField( $conf, "Shm", "APC", "radio", "apc" );
<div style="clear:left"><?php aField( $conf, "MCServers", "Memcached servers:", "text" ) ?></div>
</div>
<p class="config-desc">
- Using a shared memory system such as Turck MMCache, APC, eAccelerator, or Memcached
- will speed up MediaWiki significantly. Memcached is the best solution but needs to be
- installed. Specify the server addresses and ports in a comma-separated list. Only
- use Turck shared memory if the wiki will be running on a single Apache server.
+ An object caching system such as memcached will provide a significant performance boost,
+ but needs to be installed. Provide the server addresses and ports in a comma-separated list.
+ <br /><br />
+ MediaWiki can also detect and support eAccelerator, Turck MMCache, APC, and XCache, but
+ these should not be used if the wiki will be running on multiple application servers.
</p>
</div>
$mcservers = var_export( $conf->MCServerArray, true );
break;
case 'turck':
+ case 'xcache':
case 'apc':
case 'eaccel':
$cacheType = 'CACHE_ACCEL';
'TurckBagOStuff' => 'includes/BagOStuff.php',
'APCBagOStuff' => 'includes/BagOStuff.php',
'eAccelBagOStuff' => 'includes/BagOStuff.php',
+ 'XCacheBagOStuff' => 'includes/BagOStuff.php',
'DBABagOStuff' => 'includes/BagOStuff.php',
'Block' => 'includes/Block.php',
'HTMLFileCache' => 'includes/HTMLFileCache.php',
}
}
+/**
+ * Wrapper for XCache object caching functions; identical interface
+ * to the APC wrapper
+ */
+class XCacheBagOStuff extends APCBagOStuff {
+
+ /**
+ * Get a value from the XCache object cache
+ *
+ * @param string $key Cache key
+ * @return mixed
+ */
+ public function get( $key ) {
+ $val = xcache_get( $key );
+ if( is_string( $val ) )
+ $val = unserialize( $val );
+ return $val;
+ }
+
+ /**
+ * Store a value in the XCache object cache
+ *
+ * @param string $key Cache key
+ * @param mixed $value Object to store
+ * @param int $expire Expiration time
+ * @return bool
+ */
+ public function set( $key, $value, $expire = 0 ) {
+ xcache_set( $key, serialize( $value ), $expire );
+ return true;
+ }
+
+ /**
+ * Remove a value from the XCache object cache
+ *
+ * @param string $key Cache key
+ * @param int $time Not used in this implementation
+ * @return bool
+ */
+ public function delete( $key, $time = 0 ) {
+ xcache_unset( $key );
+ return true;
+ }
+
+}
+
/**
* @todo document
*/