[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Detect/use APCu properly

2016-10-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Detect/use APCu properly
..


Detect/use APCu properly

In PHP 5.5 and above, userland APC caching moved to an extension

Bug: T140587
Bug: T140961
Change-Id: Ie0871776cd7e67838471a4fe95451cf4164079b7
(cherry picked from commit c214c9a95255abf1032d389d0fe8bcbde38b55db)
---
M autoload.php
M includes/DefaultSettings.php
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
M includes/libs/MemoizedCallable.php
M includes/libs/objectcache/APCBagOStuff.php
A includes/libs/objectcache/APCUBagOStuff.php
M includes/objectcache/ObjectCache.php
M tests/phpunit/includes/libs/MemoizedCallableTest.php
10 files changed, 133 insertions(+), 21 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Paladox: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/autoload.php b/autoload.php
index 679f5f3..f36e613 100644
--- a/autoload.php
+++ b/autoload.php
@@ -5,6 +5,7 @@
 
 $wgAutoloadLocalClasses = [
'APCBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/APCBagOStuff.php',
+   'APCUBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/APCUBagOStuff.php',
'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php',
'Action' => __DIR__ . '/includes/actions/Action.php',
'ActiveUsersPager' => __DIR__ . 
'/includes/specials/pagers/ActiveUsersPager.php',
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 613c219..5c6d204 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2193,7 +2193,7 @@
  *   - CACHE_NONE:   Do not cache
  *   - CACHE_DB: Store cache objects in the DB
  *   - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
- *   - CACHE_ACCEL:  APC, XCache or WinCache
+ *   - CACHE_ACCEL:  APC, APCU, XCache or WinCache
  *   - (other):  A string may be used which identifies a cache
  *   configuration in $wgObjectCaches.
  *
@@ -2269,6 +2269,7 @@
],
 
'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ],
+   'apcu' => [ 'class' => 'APCUBagOStuff', 'reportDupes' => false ],
'xcache' => [ 'class' => 'XCacheBagOStuff', 'reportDupes' => false ],
'wincache' => [ 'class' => 'WinCacheBagOStuff', 'reportDupes' => false 
],
'memcached-php' => [ 'class' => 'MemcachedPhpBagOStuff', 'loggroup' => 
'memcached' ],
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 84a665d..aace867 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -242,6 +242,7 @@
protected $objectCaches = [
'xcache' => 'xcache_get',
'apc' => 'apc_fetch',
+   'apcu' => 'apcu_fetch',
'wincache' => 'wincache_ucache_get'
];
 
diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json
index 2d9b991..f5440d4 100644
--- a/includes/installer/i18n/en.json
+++ b/includes/installer/i18n/en.json
@@ -57,6 +57,7 @@
"config-memory-bad": "Warning: PHP's 
memory_limit is $1.\nThis is probably too low.\nThe installation 
may fail!",
"config-xcache": "[http://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": "[http://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-mod-security": "Warning: Your web server has 
[http://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 [http://modsecurity.org/documentation/ 
mod_security documentation] or contact your host's support if you encounter 
random errors.",
@@ -249,7 +250,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, XCache or WinCache)",
+   "config-cache-accel": "PHP object caching (APC, APCu, XCache or 
WinCache)",
"config-cache-memcached": "Use Memcached (requires additional

[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Detect/use APCu properly

2016-10-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/313756

Change subject: Detect/use APCu properly
..

Detect/use APCu properly

In PHP 5.5 and above, userland APC caching moved to an extension

Bug: T140587
Change-Id: Ie0871776cd7e67838471a4fe95451cf4164079b7
(cherry picked from commit c214c9a95255abf1032d389d0fe8bcbde38b55db)
---
M autoload.php
M includes/DefaultSettings.php
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
M includes/libs/MemoizedCallable.php
M includes/libs/objectcache/APCBagOStuff.php
A includes/libs/objectcache/APCUBagOStuff.php
M includes/objectcache/ObjectCache.php
M tests/phpunit/includes/libs/MemoizedCallableTest.php
10 files changed, 133 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/313756/1

diff --git a/autoload.php b/autoload.php
index 679f5f3..f36e613 100644
--- a/autoload.php
+++ b/autoload.php
@@ -5,6 +5,7 @@
 
 $wgAutoloadLocalClasses = [
'APCBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/APCBagOStuff.php',
+   'APCUBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/APCUBagOStuff.php',
'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php',
'Action' => __DIR__ . '/includes/actions/Action.php',
'ActiveUsersPager' => __DIR__ . 
'/includes/specials/pagers/ActiveUsersPager.php',
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 613c219..5c6d204 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2193,7 +2193,7 @@
  *   - CACHE_NONE:   Do not cache
  *   - CACHE_DB: Store cache objects in the DB
  *   - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
- *   - CACHE_ACCEL:  APC, XCache or WinCache
+ *   - CACHE_ACCEL:  APC, APCU, XCache or WinCache
  *   - (other):  A string may be used which identifies a cache
  *   configuration in $wgObjectCaches.
  *
@@ -2269,6 +2269,7 @@
],
 
'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ],
+   'apcu' => [ 'class' => 'APCUBagOStuff', 'reportDupes' => false ],
'xcache' => [ 'class' => 'XCacheBagOStuff', 'reportDupes' => false ],
'wincache' => [ 'class' => 'WinCacheBagOStuff', 'reportDupes' => false 
],
'memcached-php' => [ 'class' => 'MemcachedPhpBagOStuff', 'loggroup' => 
'memcached' ],
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 84a665d..aace867 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -242,6 +242,7 @@
protected $objectCaches = [
'xcache' => 'xcache_get',
'apc' => 'apc_fetch',
+   'apcu' => 'apcu_fetch',
'wincache' => 'wincache_ucache_get'
];
 
diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json
index 2d9b991..f5440d4 100644
--- a/includes/installer/i18n/en.json
+++ b/includes/installer/i18n/en.json
@@ -57,6 +57,7 @@
"config-memory-bad": "Warning: PHP's 
memory_limit is $1.\nThis is probably too low.\nThe installation 
may fail!",
"config-xcache": "[http://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": "[http://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-mod-security": "Warning: Your web server has 
[http://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 [http://modsecurity.org/documentation/ 
mod_security documentation] or contact your host's support if you encounter 
random errors.",
@@ -249,7 +250,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, XCache or WinCache)",
+   "config-cache-accel": "PHP object caching (APC, APCu, XCache or 
WinCache)",
"config-cache-memcached": "Use Memcached (requires additional setup and 
configuration)",