Files
KantSites/src/Kernel.php
T
kantarci 7c1c86b864
CMS quality / php (8.2) (push) Canceled after 0s
CMS quality / php (8.4) (push) Canceled after 0s
CMS quality / browser (push) Canceled after 0s
CMS quality / mysql (push) Canceled after 0s
fix: preserve running kernel cache during archive updates
2026-09-14 15:35:52 +02:00

25 lines
682 B
PHP

<?php
namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class Kernel extends BaseKernel
{
use MicroKernelTrait;
private ?string $releaseCacheDir = null;
public function getCacheDir(): string
{
// A web update still needs its compiled services until the response has finished.
// The next release builds its own cache without deleting the running request's files.
return $this->releaseCacheDir ??= parent::getCacheDir().'/release-'.substr(
hash_file('sha256', $this->getProjectDir().'/VERSION'),
0,
16,
);
}
}