mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
N°8910 - Upgrade Symfony packages (#811)
This commit is contained in:
@@ -70,17 +70,18 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
private ?string $warmupDir = null;
|
||||
private int $requestStackSize = 0;
|
||||
private bool $resetServices = false;
|
||||
private bool $handlingHttpCache = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private static array $freshCache = [];
|
||||
|
||||
public const VERSION = '6.4.25';
|
||||
public const VERSION_ID = 60425;
|
||||
public const VERSION = '6.4.33';
|
||||
public const VERSION_ID = 60433;
|
||||
public const MAJOR_VERSION = 6;
|
||||
public const MINOR_VERSION = 4;
|
||||
public const RELEASE_VERSION = 25;
|
||||
public const RELEASE_VERSION = 33;
|
||||
public const EXTRA_VERSION = '';
|
||||
|
||||
public const END_OF_MAINTENANCE = '11/2026';
|
||||
@@ -101,6 +102,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
$this->container = null;
|
||||
$this->requestStackSize = 0;
|
||||
$this->resetServices = false;
|
||||
$this->handlingHttpCache = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +110,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
if (true === $this->booted) {
|
||||
if ($this->booted) {
|
||||
if (!$this->requestStackSize && $this->resetServices) {
|
||||
if ($this->container->has('services_resetter')) {
|
||||
$this->container->get('services_resetter')->reset();
|
||||
@@ -122,7 +124,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
return;
|
||||
}
|
||||
|
||||
if (null === $this->container) {
|
||||
if (!$this->container) {
|
||||
$this->preBoot();
|
||||
}
|
||||
|
||||
@@ -149,7 +151,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
public function terminate(Request $request, Response $response)
|
||||
{
|
||||
if (false === $this->booted) {
|
||||
if (!$this->booted) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,7 +165,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
public function shutdown()
|
||||
{
|
||||
if (false === $this->booted) {
|
||||
if (!$this->booted) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,17 +183,26 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
|
||||
{
|
||||
if (!$this->booted) {
|
||||
$container = $this->container ?? $this->preBoot();
|
||||
if (!$this->container) {
|
||||
$this->preBoot();
|
||||
}
|
||||
|
||||
if ($container->has('http_cache')) {
|
||||
return $container->get('http_cache')->handle($request, $type, $catch);
|
||||
if (HttpKernelInterface::MAIN_REQUEST === $type && !$this->handlingHttpCache && $this->container->has('http_cache')) {
|
||||
$this->handlingHttpCache = true;
|
||||
|
||||
try {
|
||||
return $this->container->get('http_cache')->handle($request, $type, $catch);
|
||||
} finally {
|
||||
$this->handlingHttpCache = false;
|
||||
$this->resetServices = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->boot();
|
||||
++$this->requestStackSize;
|
||||
$this->resetServices = true;
|
||||
if (!$this->handlingHttpCache) {
|
||||
$this->resetServices = true;
|
||||
}
|
||||
|
||||
try {
|
||||
return $this->getHttpKernel()->handle($request, $type, $catch);
|
||||
@@ -603,7 +614,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
{
|
||||
foreach (['cache' => $this->getCacheDir(), 'build' => $this->warmupDir ?: $this->getBuildDir(), 'logs' => $this->getLogDir()] as $name => $dir) {
|
||||
if (!is_dir($dir)) {
|
||||
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
|
||||
if (!@mkdir($dir, 0o777, true) && !is_dir($dir)) {
|
||||
throw new \RuntimeException(\sprintf('Unable to create the "%s" directory (%s).', $name, $dir));
|
||||
}
|
||||
} elseif (!is_writable($dir)) {
|
||||
|
||||
Reference in New Issue
Block a user