From 2165bebb992a4fe29e33c0da4721a9421576ce00 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 25 Apr 2017 18:20:21 -0500 Subject: [PATCH] Improve check on APCu to avoid warnings when calling apcu_cache_info() --- main/inc/global.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index 663d425217..fabe29e9d0 100755 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -194,8 +194,11 @@ if (!empty($_configuration['multiple_access_urls'])) { // Check if APCu is available. If so, store the value in $_configuration if (extension_loaded('apcu')) { - $_configuration['apc'] = true; - $_configuration['apc_prefix'] = $_configuration['main_database'].'_'.$_configuration['access_url'].'_'; + $apcEnabled = ini_get('apc.enabled'); + if (!empty($apcEnabled) && $apcEnabled != 'Off' && $apcEnabled != 'off') { + $_configuration['apc'] = true; + $_configuration['apc_prefix'] = $_configuration['main_database'].'_'.$_configuration['access_url'].'_'; + } } $charset = 'UTF-8';