We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0ca9a0 commit 7ed575eCopy full SHA for 7ed575e
src/ContainerBuilder.php
@@ -120,10 +120,8 @@ public function build()
120
// Mutable definition source
121
$source->setMutableDefinitionSource(new DefinitionArray([], $autowiring));
122
123
- if ($this->sourceCache) {
124
- if (!SourceCache::isSupported()) {
125
- throw new \Exception('APCu is not enabled, PHP-DI cannot use it as a cache');
126
- }
+ // use cache if isSupported check passes, otherwise proceed without cache and do not throw an exception
+ if ($this->sourceCache && SourceCache::isSupported()) {
127
// Wrap the source with the cache decorator
128
$source = new SourceCache($source, $this->sourceCacheNamespace);
129
}
0 commit comments