mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-56308 cache: Fix APC ready rules for CLI scripts
When APCu is enabled, but the CLI is not it's possible for calls to enable APCu to fail because it's not configured on the command line.
This commit is contained in:
parent
d9520bc04e
commit
eca7dd65ad
3
cache/stores/apcu/lib.php
vendored
3
cache/stores/apcu/lib.php
vendored
@ -69,7 +69,8 @@ class cachestore_apcu extends cache_store implements cache_is_key_aware, cache_i
|
||||
* @return bool True if the stores software/hardware requirements have been met and it can be used. False otherwise.
|
||||
*/
|
||||
public static function are_requirements_met() {
|
||||
if (!extension_loaded('apcu') || !ini_get('apc.enabled')) {
|
||||
$enabled = ini_get('apc.enabled') && (php_sapi_name() != "cli" || ini_get('apc.enable_cli'));
|
||||
if (!extension_loaded('apcu') || !$enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user