(bug 29747) eAccelerator shared memory caching has been removed since it is now disab...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 22 Nov 2011 22:56:00 +0000 (22:56 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 22 Nov 2011 22:56:00 +0000 (22:56 +0000)
As Brion points out in <https://bugzilla.wikimedia.org/show_bug.cgi?id=29747#c7>, the shared memory functions are very buggy. In fact, eAccelerator has disabled the shared memory functions by default for awhile now. I didn't touch APC, XCache or WinCache, but I imagine they suffer from the same problems.

RELEASE-NOTES-1.19
includes/AutoLoader.php
includes/DefaultSettings.php
includes/Defines.php
includes/LocalisationCache.php
includes/installer/Installer.i18n.php
includes/installer/Installer.php
includes/objectcache/ObjectCache.php
includes/objectcache/eAccelBagOStuff.php [deleted file]

index 9dd94ec..a7c7542 100644 (file)
@@ -153,6 +153,8 @@ production.
   was specified.
 * (bug 30368) Special:Newpages now shows the new page name for moved pages
 * (bug 1697) The way to search blocked usernames in block log should be clearer
+* (bug 29747) eAccelerator shared memory caching has been removed since it is
+  now disabled by default and is buggy. APC, XCache and WinCache are not affected.
 
 === API changes in 1.19 ===
 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
index fc4467d..8d2ec0e 100644 (file)
@@ -598,7 +598,6 @@ $wgAutoloadLocalClasses = array(
        'APCBagOStuff' => 'includes/objectcache/APCBagOStuff.php',
        'BagOStuff' => 'includes/objectcache/BagOStuff.php',
        'DBABagOStuff' => 'includes/objectcache/DBABagOStuff.php',
-       'eAccelBagOStuff' => 'includes/objectcache/eAccelBagOStuff.php',
        'EhcacheBagOStuff' => 'includes/objectcache/EhcacheBagOStuff.php',
        'EmptyBagOStuff' => 'includes/objectcache/EmptyBagOStuff.php',
        'FakeMemCachedClient' => 'includes/objectcache/EmptyBagOStuff.php',
index 92fe00a..14b4e94 100644 (file)
@@ -1492,7 +1492,7 @@ $wgCacheDirectory = false;
  *   - CACHE_NONE:       Do not cache
  *   - CACHE_DB:         Store cache objects in the DB
  *   - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
- *   - CACHE_ACCEL:      eAccelerator, APC, XCache or WinCache
+ *   - CACHE_ACCEL:      APC, XCache or WinCache
  *   - CACHE_DBA:        Use PHP's DBA extension to store in a DBM-style
  *                       database. This is slow, and is not recommended for
  *                       anything other than debugging.
@@ -1542,7 +1542,6 @@ $wgObjectCaches = array(
        CACHE_ACCEL => array( 'factory' => 'ObjectCache::newAccelerator' ),
        CACHE_MEMCACHED => array( 'factory' => 'ObjectCache::newMemcached' ),
 
-       'eaccelerator' => array( 'class' => 'eAccelBagOStuff' ),
        'apc' => array( 'class' => 'APCBagOStuff' ),
        'xcache' => array( 'class' => 'XCacheBagOStuff' ),
        'wincache' => array( 'class' => 'WinCacheBagOStuff' ),
index fc39af5..26deb2b 100644 (file)
@@ -92,7 +92,7 @@ define( 'CACHE_ANYTHING', -1 );  // Use anything, as long as it works
 define( 'CACHE_NONE', 0 );       // Do not cache
 define( 'CACHE_DB', 1 );         // Store cache objects in the DB
 define( 'CACHE_MEMCACHED', 2 );  // MemCached, must specify servers in $wgMemCacheServers
-define( 'CACHE_ACCEL', 3 );      // eAccelerator
+define( 'CACHE_ACCEL', 3 );      // APC, XCache or WinCache
 define( 'CACHE_DBA', 4 );        // Use PHP's DBA extension to store in a DBM-style database
 /**@}*/
 
index ad707dc..c44be13 100644 (file)
@@ -842,7 +842,7 @@ interface LCStore {
 
 /**
  * LCStore implementation which uses PHP accelerator to store data.
- * This will work if one of XCache, eAccelerator, or APC cacher is configured.
+ * This will work if one of XCache, WinCache or APC cacher is configured.
  * (See ObjectCache.php)
  */
 class LCStore_Accel implements LCStore {
index d9f397a..955f393 100644 (file)
@@ -134,9 +134,8 @@ This is probably too low.
 The installation may fail!",
        'config-xcache'                   => '[http://xcache.lighttpd.net/ XCache] is installed',
        'config-apc'                      => '[http://www.php.net/apc APC] is installed',
-       'config-eaccel'                   => '[http://eaccelerator.sourceforge.net/ eAccelerator] is installed',
        'config-wincache'                 => '[http://www.iis.net/download/WinCacheForPhp WinCache] is installed',
-       'config-no-cache'                 => "'''Warning:''' Could not find [http://eaccelerator.sourceforge.net eAccelerator], [http://www.php.net/apc APC], [http://xcache.lighttpd.net/ XCache] or [http://www.iis.net/download/WinCacheForPhp WinCache].
+       'config-no-cache'                 => "'''Warning:''' Could not find [http://www.php.net/apc APC], [http://xcache.lighttpd.net/ XCache] or [http://www.iis.net/download/WinCacheForPhp WinCache].
 Object caching is not enabled.",
        'config-mod-security'             => "'''Warning''': your web server has [http://modsecurity.org/ mod_security] enabled. If misconfigured, it can cause problems for MediaWiki or other software that allows users to post arbitrary content.
 Refer to [http://modsecurity.org/documentation/ mod_security documentation] or contact your host's support if you encounter random errors.",
@@ -472,7 +471,7 @@ Enter the license name manually.',
        'config-cache-help'               => 'Object caching is used to improve the speed of MediaWiki by caching frequently used data.
 Medium to large sites are highly encouraged to enable this, and small sites will see benefits as well.',
        'config-cache-none'               => 'No caching (no functionality is removed, but speed may be impacted on larger wiki sites)',
-       'config-cache-accel'              => 'PHP object caching (APC, eAccelerator, XCache or WinCache)',
+       'config-cache-accel'              => 'PHP object caching (APC, XCache or WinCache)',
        'config-cache-memcached'          => 'Use Memcached (requires additional setup and configuration)',
        'config-memcached-servers'        => 'Memcached servers:',
        'config-memcached-help'           => 'List of IP addresses to use for Memcached.
@@ -606,7 +605,6 @@ Parameters:
 * $1 is the configured <code>memory_limit</code>.',
        'config-xcache' => 'Message indicates if this program is available',
        'config-apc' => 'Message indicates if this program is available',
-       'config-eaccel' => 'Message indicates if this program is available',
        'config-wincache' => 'Message indicates if this program is available',
        'config-imagemagick' => '$1 is ImageMagick\'s <code>convert</code> executable file name.
 
index 35d4ddf..3e8a88b 100644 (file)
@@ -205,7 +205,6 @@ abstract class Installer {
        protected $objectCaches = array(
                'xcache' => 'xcache_get',
                'apc' => 'apc_fetch',
-               'eaccel' => 'eaccelerator_get',
                'wincache' => 'wincache_ucache_get'
        );
 
index a9c5207..77ca837 100644 (file)
@@ -89,9 +89,7 @@ class ObjectCache {
         * @return ObjectCache
         */
        static function newAccelerator( $params ) {
-               if ( function_exists( 'eaccelerator_get' ) ) {
-                       $id = 'eaccelerator';
-               } elseif ( function_exists( 'apc_fetch') ) {
+               if ( function_exists( 'apc_fetch') ) {
                        $id = 'apc';
                } elseif( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) {
                        $id = 'xcache';
diff --git a/includes/objectcache/eAccelBagOStuff.php b/includes/objectcache/eAccelBagOStuff.php
deleted file mode 100644 (file)
index 30d24e8..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/**
- * This is a wrapper for eAccelerator's shared memory functions.
- *
- * This is basically identical to the deceased Turck MMCache version,
- * mostly because eAccelerator is based on Turck MMCache.
- *
- * @ingroup Cache
- */
-class eAccelBagOStuff extends BagOStuff {
-       public function get( $key ) {
-               $val = eaccelerator_get( $key );
-
-               if ( is_string( $val ) ) {
-                       $val = unserialize( $val );
-               }
-
-               return $val;
-       }
-
-       public function set( $key, $value, $exptime = 0 ) {
-               eaccelerator_put( $key, serialize( $value ), $exptime );
-
-               return true;
-       }
-
-       public function delete( $key, $time = 0 ) {
-               eaccelerator_rm( $key );
-
-               return true;
-       }
-
-       public function lock( $key, $waitTimeout = 0 ) {
-               eaccelerator_lock( $key );
-
-               return true;
-       }
-
-       public function unlock( $key ) {
-               eaccelerator_unlock( $key );
-
-               return true;
-       }
-}
-