mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7623 from andrewandante/bugfix/apcu_cli
check for apc.enable_cli when running from CLI
This commit is contained in:
commit
9f0917ff5c
@ -5,6 +5,7 @@ namespace SilverStripe\Core\Cache;
|
||||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
use SilverStripe\Control\Director;
|
||||
use SilverStripe\Core\Injector\Injector;
|
||||
use Symfony\Component\Cache\Simple\FilesystemCache;
|
||||
use Symfony\Component\Cache\Simple\ApcuCache;
|
||||
@ -85,7 +86,8 @@ class DefaultCacheFactory implements CacheFactory
|
||||
{
|
||||
static $apcuSupported = null;
|
||||
if (null === $apcuSupported) {
|
||||
$apcuSupported = ApcuAdapter::isSupported();
|
||||
// Need to check for CLI because Symfony won't: https://github.com/symfony/symfony/pull/25080
|
||||
$apcuSupported = Director::is_cli() ? ini_get('apc.enable_cli') && ApcuAdapter::isSupported() : ApcuAdapter::isSupported();
|
||||
}
|
||||
return $apcuSupported;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user