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 7f8e6e0 commit 64c6a36Copy full SHA for 64c6a36
src/ContainerBuilder.php
@@ -125,10 +125,8 @@ public function build()
125
// Mutable definition source
126
$source->setMutableDefinitionSource(new DefinitionArray([], $autowiring));
127
128
- if ($this->sourceCache) {
129
- if (!SourceCache::isSupported()) {
130
- throw new \Exception('APCu is not enabled, PHP-DI cannot use it as a cache');
131
- }
+ // use cache if isSupported check passes, otherwise proceed without cache and do not throw an exception
+ if ($this->sourceCache && SourceCache::isSupported()) {
132
// Wrap the source with the cache decorator
133
$source = new SourceCache($source, $this->sourceCacheNamespace);
134
}
0 commit comments