Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add apcu enabled check if apcu extension loaded (#10310) #10311

Merged
merged 4 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/ORMSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use function class_exists;
use function extension_loaded;
use function ini_get;
use function md5;
use function sprintf;
use function sys_get_temp_dir;
Expand Down Expand Up @@ -181,7 +182,7 @@ private static function createCacheInstance(

$namespace = 'dc2_' . md5($proxyDir);

if (extension_loaded('apcu')) {
if (extension_loaded('apcu') && ini_get('apc.enabled')) {
aleksejs1 marked this conversation as resolved.
Show resolved Hide resolved
return new ApcuAdapter($namespace);
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/Tools/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use function dirname;
use function extension_loaded;
use function file_exists;
use function ini_get;
use function md5;
use function sys_get_temp_dir;

Expand Down Expand Up @@ -236,7 +237,7 @@ private static function createCacheInstance(bool $isDevMode, ?Cache $cache): Cac

if ($isDevMode === true) {
$cache = class_exists(ArrayCache::class) ? new ArrayCache() : new ArrayAdapter();
} elseif (extension_loaded('apcu')) {
} elseif (extension_loaded('apcu') && ini_get('apc.enabled')) {
aleksejs1 marked this conversation as resolved.
Show resolved Hide resolved
$cache = class_exists(ApcuCache::class) ? new ApcuCache() : new ApcuAdapter();
} elseif (extension_loaded('memcached') && (class_exists(MemcachedCache::class) || MemcachedAdapter::isSupported())) {
$memcached = new Memcached();
Expand Down