Skip to content

Commit 5ce42ed

Browse files
committed
CacheExtension: accepts complete path (BC break)
1 parent ec73e13 commit 5ce42ed

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Bridges/CacheDI/CacheExtension.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,22 @@ public function loadConfiguration(): void
2929
if (!FileSystem::isAbsolute($this->tempDir)) {
3030
throw new Nette\InvalidArgumentException("Cache directory must be absolute, '$this->tempDir' given.");
3131
}
32-
$dir = $this->tempDir . '/cache';
33-
FileSystem::createDir($dir);
34-
if (!is_writable($dir)) {
35-
throw new Nette\InvalidStateException("Make directory '$dir' writable.");
32+
FileSystem::createDir($this->tempDir);
33+
if (!is_writable($this->tempDir)) {
34+
throw new Nette\InvalidStateException("Make directory '$this->tempDir' writable.");
3635
}
3736

3837
$builder = $this->getContainerBuilder();
3938

4039
if (extension_loaded('pdo_sqlite')) {
4140
$builder->addDefinition($this->prefix('journal'))
4241
->setType(Nette\Caching\Storages\Journal::class)
43-
->setFactory(Nette\Caching\Storages\SQLiteJournal::class, [$dir . '/journal.s3db']);
42+
->setFactory(Nette\Caching\Storages\SQLiteJournal::class, [$this->tempDir . '/journal.s3db']);
4443
}
4544

4645
$builder->addDefinition($this->prefix('storage'))
4746
->setType(Nette\Caching\Storage::class)
48-
->setFactory(Nette\Caching\Storages\FileStorage::class, [$dir]);
47+
->setFactory(Nette\Caching\Storages\FileStorage::class, [$this->tempDir]);
4948

5049
if ($this->name === 'cache') {
5150
if (extension_loaded('pdo_sqlite')) {

0 commit comments

Comments
 (0)