Drop XCache support
authorChad Horohoe <chadh@wikimedia.org>
Tue, 6 Feb 2018 02:11:27 +0000 (18:11 -0800)
committerChad Horohoe <chadh@wikimedia.org>
Wed, 7 Feb 2018 21:45:40 +0000 (13:45 -0800)
It was never super popular anyway, APC was always the best option.
The project has no plans to move to PHP7, so it's quickly reaching
its end of life. Oh, and Fedora dropped it from their repos 2 years
ago.

Change-Id: Ia3257e86a6323d8943f04a5c05c72c0bd4c4b0a9

15 files changed:
RELEASE-NOTES-1.31
autoload.php
docs/distributors.txt
includes/DefaultSettings.php
includes/Defines.php
includes/ServiceWiring.php
includes/installer/Installer.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json
includes/libs/filebackend/FileBackendStore.php
includes/libs/filebackend/SwiftFileBackend.php
includes/libs/objectcache/XCacheBagOStuff.php [deleted file]
includes/utils/UIDGenerator.php
maintenance/dictionary/mediawiki.dic
tests/phpunit/MediaWikiTestCase.php

index 84f8149..8683054 100644 (file)
@@ -24,6 +24,8 @@ production.
 * $wgFragmentMode is now set to [ 'legacy', 'html5' ] by default. This is a first step of
   migration to human-readable section IDs that will later result in 'html5' being the
   default mode.
+* CACHE_ACCEL now only supports APC(u) or WinCache. XCache support was removed
+  as upstream is inactive and has no plans to move to PHP 7.
 
 === New features in 1.31 ===
 * Wikimedia\Rdbms\IDatabase->select() and similar methods now support
index 09abbff..9618a8f 100644 (file)
@@ -1720,7 +1720,6 @@ $wgAutoloadLocalClasses = [
        'WordLevelDiff' => __DIR__ . '/includes/diff/WordLevelDiff.php',
        'WrapOldPasswords' => __DIR__ . '/maintenance/wrapOldPasswords.php',
        'XCFHandler' => __DIR__ . '/includes/media/XCF.php',
-       'XCacheBagOStuff' => __DIR__ . '/includes/libs/objectcache/XCacheBagOStuff.php',
        'XMLRCFeedFormatter' => __DIR__ . '/includes/rcfeed/XMLRCFeedFormatter.php',
        'XMPInfo' => __DIR__ . '/includes/libs/xmp/XMPInfo.php',
        'XMPReader' => __DIR__ . '/includes/libs/xmp/XMP.php',
index f19574c..7581110 100644 (file)
@@ -162,14 +162,14 @@ There are several other pieces of software that MediaWiki can make good use of.
 Distributors might choose to install these automatically with MediaWiki and
 perhaps configure it to use them (see Configuration section of this document):
 
-  * APC (Alternative PHP Cache), XCache, or similar: Will greatly speed up the
+  * APC (Alternative PHP Cache) or similar: Will greatly speed up the
   execution of MediaWiki, and all other PHP applications, at some cost in
   memory usage. Will be used automatically for the most part.
   * clamav: Can be used for virus scanning of uploaded files. Enable with
   "$wgAntivirus = 'clamav';".
   * DjVuLibre: Allows processing of DjVu files. To enable this, set
   "$wgDjvuDump = 'djvudump'; $wgDjvuRenderer = 'ddjvu'; $wgDjvuTxt = 'djvutxt';".
-  * HTML Tidy: Fixes errors in HTML at runtime. Can be enabled with 
+  * HTML Tidy: Fixes errors in HTML at runtime. Can be enabled with
        "$wgUseTidy = true;".
   * ImageMagick: For resizing images. "$wgUseImageMagick = true;" will enable
   it. PHP's GD can also be used, but ImageMagick is preferable.
index 4a625cb..bdbeb70 100644 (file)
@@ -2255,7 +2255,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:      APC, APCU, XCache or WinCache
+ *   - CACHE_ACCEL:      APC, APCU or WinCache
  *   - (other):          A string may be used which identifies a cache
  *                       configuration in $wgObjectCaches.
  *
@@ -2333,7 +2333,6 @@ $wgObjectCaches = [
 
        'apc' => [ 'class' => APCBagOStuff::class, 'reportDupes' => false ],
        'apcu' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
-       'xcache' => [ 'class' => XCacheBagOStuff::class, 'reportDupes' => false ],
        'wincache' => [ 'class' => WinCacheBagOStuff::class, 'reportDupes' => false ],
        'memcached-php' => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ],
        'memcached-pecl' => [ 'class' => MemcachedPeclBagOStuff::class, 'loggroup' => 'memcached' ],
index ca603e7..087af39 100644 (file)
@@ -103,7 +103,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 );      // APC, XCache or WinCache
+define( 'CACHE_ACCEL', 3 );      // APC or WinCache
 /**@}*/
 
 /**@{
index 397a7d2..0ab5f6d 100644 (file)
@@ -398,8 +398,6 @@ return [
                        $id = 'apc';
                } elseif ( function_exists( 'apcu_fetch' ) ) {
                        $id = 'apcu';
-               } elseif ( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) {
-                       $id = 'xcache';
                } elseif ( function_exists( 'wincache_ucache_get' ) ) {
                        $id = 'wincache';
                } else {
index e42146d..439b370 100644 (file)
@@ -243,7 +243,6 @@ abstract class Installer {
         * @var array
         */
        protected $objectCaches = [
-               'xcache' => 'xcache_get',
                'apc' => 'apc_fetch',
                'apcu' => 'apcu_fetch',
                'wincache' => 'wincache_ucache_get'
@@ -857,9 +856,6 @@ abstract class Installer {
                $caches = [];
                foreach ( $this->objectCaches as $name => $function ) {
                        if ( function_exists( $function ) ) {
-                               if ( $name == 'xcache' && !wfIniGetBool( 'xcache.var_size' ) ) {
-                                       continue;
-                               }
                                $caches[$name] = true;
                        }
                }
index fee7b13..f1b7080 100644 (file)
        "config-pcre-no-utf8": "<strong>Fatal:</strong> PHP's PCRE module seems to be compiled without PCRE_UTF8 support.\nMediaWiki requires UTF-8 support to function correctly.",
        "config-memory-raised": "PHP's <code>memory_limit</code> is $1, raised to $2.",
        "config-memory-bad": "<strong>Warning:</strong> PHP's <code>memory_limit</code> is $1.\nThis is probably too low.\nThe installation may fail!",
-       "config-xcache": "[https://xcache.lighttpd.net/ XCache] is installed",
        "config-apc": "[http://www.php.net/apc APC] is installed",
        "config-apcu": "[http://www.php.net/apcu APCu] is installed",
        "config-wincache": "[https://www.iis.net/download/WinCacheForPhp WinCache] is installed",
-       "config-no-cache-apcu": "<strong>Warning:</strong> Could not find [http://www.php.net/apcu APCu], [http://xcache.lighttpd.net/ XCache] or [http://www.iis.net/download/WinCacheForPhp WinCache].\nObject caching is not enabled.",
+       "config-no-cache-apcu": "<strong>Warning:</strong> Could not find [http://www.php.net/apcu APCu] or [http://www.iis.net/download/WinCacheForPhp WinCache].\nObject caching is not enabled.",
        "config-mod-security": "<strong>Warning:</strong> Your web server has [https://modsecurity.org/ mod_security]/mod_security2 enabled. Many common configurations of this will cause problems for MediaWiki and other software that allows users to post arbitrary content.\nIf possible, this should be disabled. Otherwise, refer to [https://modsecurity.org/documentation/ mod_security documentation] or contact your host's support if you encounter random errors.",
        "config-diff3-bad": "GNU diff3 not found.",
        "config-git": "Found the Git version control software: <code>$1</code>.",
        "config-cache-options": "Settings for object caching:",
        "config-cache-help": "Object caching is used to improve the speed of MediaWiki by caching frequently used data.\nMedium 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, APCu, XCache or WinCache)",
+       "config-cache-accel": "PHP object caching (APC, APCu 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.\nShould specify one per line and specify the port to be used. For example:\n 127.0.0.1:11211\n 192.168.1.25:1234",
index 17ab30d..d82c74b 100644 (file)
@@ -76,7 +76,6 @@
        "config-pcre-no-utf8": "PCRE is a name of a programmers' library for supporting regular expressions. It can probably be translated without change.\n{{Related|Config-fatal}}",
        "config-memory-raised": "Parameters:\n* $1 is the configured <code>memory_limit</code>.\n* $2 is the value to which <code>memory_limit</code> was raised.",
        "config-memory-bad": "Parameters:\n* $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-apcu": "Message indicates if this program is available",
        "config-wincache": "Message indicates if this program is available",
index da8b4ce..dba5a1c 100644 (file)
@@ -60,7 +60,7 @@ abstract class FileBackendStore extends FileBackend {
        /**
         * @see FileBackend::__construct()
         * Additional $config params include:
-        *   - srvCache     : BagOStuff cache to APC/XCache or the like.
+        *   - srvCache     : BagOStuff cache to APC or the like.
         *   - wanCache     : WANObjectCache object to use for persistent caching.
         *   - mimeCallback : Callback that takes (storage path, content, file system path) and
         *                    returns the MIME type of the file or 'unknown/unknown'. The file
index 27ce212..e606162 100644 (file)
@@ -87,7 +87,7 @@ class SwiftFileBackend extends FileBackendStore {
         *                             - levels : the number of hash levels (and digits)
         *                             - repeat : hash subdirectories are prefixed with all the
         *                                        parent hash directory names (e.g. "a/ab/abc")
-        *   - cacheAuthInfo      : Whether to cache authentication tokens in APC, XCache, ect.
+        *   - cacheAuthInfo      : Whether to cache authentication tokens in APC, etc.
         *                          If those are not available, then the main cache will be used.
         *                          This is probably insecure in shared hosting environments.
         *   - rgwS3AccessKey     : Rados Gateway S3 "access key" value on the account.
diff --git a/includes/libs/objectcache/XCacheBagOStuff.php b/includes/libs/objectcache/XCacheBagOStuff.php
deleted file mode 100644 (file)
index 47c2906..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-/**
- * Object caching using XCache.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Cache
- */
-
-/**
- * Wrapper for XCache object caching functions; identical interface
- * to the APC wrapper
- *
- * @ingroup Cache
- */
-class XCacheBagOStuff extends BagOStuff {
-       protected function doGet( $key, $flags = 0 ) {
-               $val = xcache_get( $key );
-
-               if ( is_string( $val ) ) {
-                       if ( $this->isInteger( $val ) ) {
-                               $val = intval( $val );
-                       } else {
-                               $val = unserialize( $val );
-                       }
-               } elseif ( is_null( $val ) ) {
-                       return false;
-               }
-
-               return $val;
-       }
-
-       public function set( $key, $value, $expire = 0, $flags = 0 ) {
-               if ( !$this->isInteger( $value ) ) {
-                       $value = serialize( $value );
-               }
-
-               xcache_set( $key, $value, $expire );
-               return true;
-       }
-
-       public function delete( $key ) {
-               xcache_unset( $key );
-               return true;
-       }
-
-       public function incr( $key, $value = 1 ) {
-               return xcache_inc( $key, $value );
-       }
-
-       public function decr( $key, $value = 1 ) {
-               return xcache_dec( $key, $value );
-       }
-}
index 68ef57a..164615a 100644 (file)
@@ -364,7 +364,7 @@ class UIDGenerator {
 
                $counter = null; // post-increment persistent counter value
 
-               // Use APC/eAccelerator/xcache if requested, available, and not in CLI mode;
+               // Use APC/etc if requested, available, and not in CLI mode;
                // Counter values would not survive accross script instances in CLI mode.
                $cache = null;
                if ( ( $flags & self::QUICK_VOLATILE ) && !wfIsCLI() ) {
index 7c3c95d..e3c7e0f 100644 (file)
@@ -4585,7 +4585,6 @@ wrongpassword
 x
 xanalytics
 xbitmap
-xcache
 xcancel
 xdebug
 xdiff
index 3f4c8c0..01a34b8 100644 (file)
@@ -267,7 +267,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                                CACHE_MEMCACHED => $hashCache,
                                'apc' => $hashCache,
                                'apcu' => $hashCache,
-                               'xcache' => $hashCache,
                                'wincache' => $hashCache,
                        ] + $baseConfig->get( 'ObjectCaches' );