25 lines
682 B
PHP
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,
|
|
);
|
|
}
|
|
}
|