]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use APCu only if available in version 4.0.6 and higher
authorLukas Reschke <lukas@owncloud.com>
Mon, 16 Feb 2015 21:36:08 +0000 (22:36 +0100)
committerLukas Reschke <lukas@owncloud.com>
Tue, 17 Feb 2015 12:28:02 +0000 (13:28 +0100)
APCu before 4.0.6 is unbelievable buggy and tend to segfault the PHP process (i.e. the whole webserver)

This potentially fixes https://github.com/owncloud/core/issues/14175

Requires a backport to stable8

lib/private/memcache/apcu.php
settings/admin.php
settings/templates/admin.php

index 7f780f327189e594f2092fab29b99c80629b4344..1043690a361ce500667cf852817c079d72b0f939 100644 (file)
@@ -14,6 +14,8 @@ class APCu extends APC {
                        return false;
                } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) {
                        return false;
+               } elseif (version_compare(phpversion('apc'), '4.0.6') === -1) {
+                       return false;
                } else {
                        return true;
                }
index cdbc2700a8dd05f292d30e23fd706df8a36ead08..32e92edb145e990287dee0b86a29a71dca3904ac 100644 (file)
@@ -85,6 +85,10 @@ $template->assign('databaseOverload', $databaseOverload);
 // warn if Windows is used
 $template->assign('WindowsWarning', OC_Util::runningOnWindows());
 
+// warn if outdated version of APCu is used
+$template->assign('ApcuOutdatedWarning',
+       extension_loaded('apcu') && version_compare(phpversion('apc'), '4.0.6') === -1);
+
 // add hardcoded forms from the template
 $forms = OC_App::getForms('admin');
 $l = OC_L10N::get('settings');
index 363b4741b74799fe9de54856af08b0093b247e7d..1f7eacd746baf9eb73862cc5ae251f2a679a51cd 100644 (file)
@@ -143,9 +143,24 @@ if ($_['WindowsWarning']) {
        </p>
 
 </div>
+
 <?php
 }
 
+// APCU Warning if outdated
+if ($_['ApcuOutdatedWarning']) {
+       ?>
+       <div class="section">
+               <h2><?php p($l->t('APCu below version 4.0.6 installed'));?></h2>
+
+               <p class="securitywarning">
+                       <?php p($l->t('APCu below version 4.0.6 is installed, for stability and performance reasons we recommend to update to a newer APCu version.')); ?>
+               </p>
+
+       </div>
+
+<?php
+}
 // if module fileinfo available?
 if (!$_['has_fileinfo']) {
        ?>