Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ private function addCacheSection(ArrayNodeDefinition $rootNode, callable $willBe
->info('System related cache pools configuration.')
->defaultValue('cache.adapter.system')
->end()
->scalarNode('directory')->defaultValue('%kernel.share_dir%/pools/app')->end()
->scalarNode('directory')->defaultValue('%kernel.share_dir%/app_cache/%kernel.environment%')->end()
->scalarNode('default_psr6_provider')->end()
->scalarNode('default_redis_provider')->defaultValue('redis://localhost')->end()
->scalarNode('default_valkey_provider')->defaultValue('valkey://localhost')->end()
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function __construct(
if ($cache instanceof StoreInterface) {
$this->store = $cache;
} else {
$cache ??= null !== ($dir = $kernel->getShareDir()) ? $dir.'/http_cache/'.$kernel->getEnvironment() : $kernel->getCacheDir().'/http_cache';
$this->cacheDir = $cache;
}

Expand Down Expand Up @@ -83,6 +84,6 @@ protected function createSurrogate(): SurrogateInterface

protected function createStore(): StoreInterface
{
return $this->store ?? new Store($this->cacheDir ?: ($this->kernel->getShareDir() ?? $this->kernel->getCacheDir()).'/http_cache');
return $this->store ?? new Store($this->cacheDir);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getShareDir(): ?string
return null;
}
if (\is_string($dir)) {
return $dir.'/'.$this->environment;
return $dir;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ protected static function getBundleDefaultConfig()
'pools' => [],
'app' => 'cache.adapter.filesystem',
'system' => 'cache.adapter.system',
'directory' => '%kernel.share_dir%/pools/app',
'directory' => '%kernel.share_dir%/app_cache/%kernel.environment%',
'default_redis_provider' => 'redis://localhost',
'default_valkey_provider' => 'valkey://localhost',
'default_memcached_provider' => 'memcached://localhost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testGetShareDirCustomPathFromEnv()
try {
$kernel = $this->kernel = new ConcreteMicroKernel('test', false);

$expected = rtrim(sys_get_temp_dir(), '/').'/test';
$expected = rtrim(sys_get_temp_dir(), '/');
$this->assertSame($expected, $kernel->getShareDir());

$parameters = $kernel->getKernelParameters();
Expand Down
Loading