From: Chad Horohoe Date: Tue, 6 Feb 2018 02:11:27 +0000 (-0800) Subject: Drop XCache support X-Git-Tag: 1.31.0-rc.0~669^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=5c93fabafd32296764183e087d29d3644211d2d6 Drop XCache support 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 --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 84f814922d..8683054e3d 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -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 diff --git a/autoload.php b/autoload.php index 09abbfff08..9618a8f7f3 100644 --- a/autoload.php +++ b/autoload.php @@ -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', diff --git a/docs/distributors.txt b/docs/distributors.txt index f19574c06c..758111009f 100644 --- a/docs/distributors.txt +++ b/docs/distributors.txt @@ -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. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 4a625cbf77..bdbeb70d6e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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' ], diff --git a/includes/Defines.php b/includes/Defines.php index ca603e7684..087af39db4 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -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 /**@}*/ /**@{ diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 397a7d25c3..0ab5f6d3d8 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -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 { diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index e42146d51b..439b370ce2 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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; } } diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index fee7b13374..f1b70806b4 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -55,11 +55,10 @@ "config-pcre-no-utf8": "Fatal: 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 memory_limit is $1, raised to $2.", "config-memory-bad": "Warning: PHP's memory_limit 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": "Warning: 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": "Warning: 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": "Warning: 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: $1.", @@ -248,7 +247,7 @@ "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", diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json index 17ab30da03..d82c74b162 100644 --- a/includes/installer/i18n/qqq.json +++ b/includes/installer/i18n/qqq.json @@ -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 memory_limit.\n* $2 is the value to which memory_limit was raised.", "config-memory-bad": "Parameters:\n* $1 is the configured memory_limit.", - "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", diff --git a/includes/libs/filebackend/FileBackendStore.php b/includes/libs/filebackend/FileBackendStore.php index da8b4ce9da..dba5a1c700 100644 --- a/includes/libs/filebackend/FileBackendStore.php +++ b/includes/libs/filebackend/FileBackendStore.php @@ -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 diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php index 27ce212bad..e606162a28 100644 --- a/includes/libs/filebackend/SwiftFileBackend.php +++ b/includes/libs/filebackend/SwiftFileBackend.php @@ -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 index 47c29064b1..0000000000 --- a/includes/libs/objectcache/XCacheBagOStuff.php +++ /dev/null @@ -1,68 +0,0 @@ -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 ); - } -} diff --git a/includes/utils/UIDGenerator.php b/includes/utils/UIDGenerator.php index 68ef57ae24..164615ae78 100644 --- a/includes/utils/UIDGenerator.php +++ b/includes/utils/UIDGenerator.php @@ -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() ) { diff --git a/maintenance/dictionary/mediawiki.dic b/maintenance/dictionary/mediawiki.dic index 7c3c95d712..e3c7e0ffdd 100644 --- a/maintenance/dictionary/mediawiki.dic +++ b/maintenance/dictionary/mediawiki.dic @@ -4585,7 +4585,6 @@ wrongpassword x xanalytics xbitmap -xcache xcancel xdebug xdiff diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 3f4c8c0c88..01a34b8220 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -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' );