diff --git a/src/Bridges/CacheDI/CacheExtension.php b/src/Bridges/CacheDI/CacheExtension.php index 3a5c176a..bcdcbbde 100644 --- a/src/Bridges/CacheDI/CacheExtension.php +++ b/src/Bridges/CacheDI/CacheExtension.php @@ -29,16 +29,20 @@ public function loadConfiguration() { $container = $this->getContainerBuilder(); - $container->addDefinition($this->prefix('journal')) - ->setClass('Nette\Caching\Storages\IJournal') - ->setFactory('Nette\Caching\Storages\SQLiteJournal', [$this->tempDir . '/cache/journal.s3db']); + if (extension_loaded('pdo_sqlite')) { + $container->addDefinition($this->prefix('journal')) + ->setClass('Nette\Caching\Storages\IJournal') + ->setFactory('Nette\Caching\Storages\SQLiteJournal', [$this->tempDir . '/cache/journal.s3db']); + } $container->addDefinition($this->prefix('storage')) ->setClass('Nette\Caching\IStorage') ->setFactory('Nette\Caching\Storages\FileStorage', [$this->tempDir . '/cache']); if ($this->name === 'cache') { - $container->addAlias('nette.cacheJournal', $this->prefix('journal')); + if (extension_loaded('pdo_sqlite')) { + $container->addAlias('nette.cacheJournal', $this->prefix('journal')); + } $container->addAlias('cacheStorage', $this->prefix('storage')); } }