Skip to content

Commit

Permalink
CacheExtension: complete path is passed since nette/caching 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 10, 2024
1 parent 3dc03fc commit 226e2df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Bootstrap/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Nette\Bootstrap;

use Composer\Autoload\ClassLoader;
use Composer\InstalledVersions;
use Latte;
use Nette;
use Nette\DI;
Expand All @@ -32,7 +33,7 @@ class Configurator

public array $defaultExtensions = [
'application' => [Nette\Bridges\ApplicationDI\ApplicationExtension::class, ['%debugMode%', ['%appDir%'], '%tempDir%/cache/nette.application']],
'cache' => [Nette\Bridges\CacheDI\CacheExtension::class, ['%tempDir%']],
'cache' => [Nette\Bridges\CacheDI\CacheExtension::class, ['%tempDir%/cache']],
'constants' => Extensions\ConstantsExtension::class,
'database' => [Nette\Bridges\DatabaseDI\DatabaseExtension::class, ['%debugMode%']],
'decorator' => Nette\DI\Extensions\DecoratorExtension::class,
Expand Down Expand Up @@ -71,6 +72,13 @@ class Configurator
public function __construct()
{
$this->staticParameters = $this->getDefaultParameters();

if (class_exists(InstalledVersions::class) // back compatibility
&& InstalledVersions::isInstalled('nette/caching')
&& version_compare(InstalledVersions::getVersion('nette/caching'), '3.3.0', '<')
) {
$this->defaultExtensions['cache'][1][0] = '%tempDir%';
}
}


Expand Down

0 comments on commit 226e2df

Please sign in to comment.