Skip to content

Commit 0506903

Browse files
sabbelasichonsimonschaufi
authored andcommitted
[BUGFIX] Fix surf Symfony Container cache for a new release
1 parent febbf24 commit 0506903

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bin/surf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use TYPO3\Surf\Cli\Symfony\ConsoleKernel;
2020
requireAutoloader();
2121

2222

23-
$kernel = new ConsoleKernel('prod');
23+
$kernel = new ConsoleKernel('prod', '3.6.1');
2424
$kernel->boot();
2525
$container = $kernel->getContainer();
2626
/** @var ConsoleApplication $application */

src/Cli/Symfony/ConsoleKernel.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ final class ConsoleKernel
3131
private ?Container $container = null;
3232
private string $environment;
3333
private ?string $projectDir = null;
34+
private string $version;
3435

35-
public function __construct(string $environment = 'dev')
36+
public function __construct(string $environment = 'dev', string $version = '')
3637
{
3738
$this->environment = $environment;
39+
$this->version = str_replace('.', '_', $version);
3840
}
3941

4042
private function registerContainerConfiguration(LoaderInterface $loader): void
@@ -122,10 +124,10 @@ private function initializeContainer(): void
122124
protected function getCacheDir(): string
123125
{
124126
if (Phar::running() !== '') {
125-
return sys_get_temp_dir() . '/_surf';
127+
return sys_get_temp_dir() . '/_surf_' . $this->version;
126128
}
127129

128-
return $this->getProjectDir() . '/var/cache/' . $this->environment;
130+
return $this->getProjectDir() . '/var/cache/' . $this->version . '/' . $this->environment;
129131
}
130132

131133
private function getProjectDir(): string

0 commit comments

Comments
 (0)