mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 14:28:53 +02:00
N°9319 increase php min. version to 8.2 (#887)
* Update minimum PHP version to 8.2 * Fix previous wrong resolution of merge conflict
This commit is contained in:
@@ -1233,8 +1233,7 @@ class FrameworkExtension extends Extension
|
||||
$container->setParameter('request_listener.https_port', $config['https_port']);
|
||||
|
||||
if (null !== $config['default_uri']) {
|
||||
$container->getDefinition('router.request_context')
|
||||
->replaceArgument(0, $config['default_uri']);
|
||||
$container->setParameter('router.request_context.base_url', $config['default_uri']);
|
||||
}
|
||||
|
||||
if ($this->isInitializedConfigEnabled('annotations') && (new \ReflectionClass(AttributeClassLoader::class))->hasProperty('reader')) {
|
||||
@@ -1265,6 +1264,7 @@ class FrameworkExtension extends Extension
|
||||
}
|
||||
|
||||
$container->setParameter('session.storage.options', $options);
|
||||
$container->setParameter('session.metadata.cookie_lifetime', $options['cookie_lifetime'] ?? null);
|
||||
|
||||
// session handler (the internal callback registered with PHP session management)
|
||||
if (null === $config['handler_id']) {
|
||||
|
||||
@@ -43,6 +43,7 @@ return static function (ContainerConfigurator $container) {
|
||||
->args([
|
||||
param('session.metadata.storage_key'),
|
||||
param('session.metadata.update_threshold'),
|
||||
param('session.metadata.cookie_lifetime'),
|
||||
]),
|
||||
false,
|
||||
])
|
||||
@@ -53,6 +54,7 @@ return static function (ContainerConfigurator $container) {
|
||||
->args([
|
||||
param('session.metadata.storage_key'),
|
||||
param('session.metadata.update_threshold'),
|
||||
param('session.metadata.cookie_lifetime'),
|
||||
]),
|
||||
false,
|
||||
])
|
||||
@@ -64,6 +66,7 @@ return static function (ContainerConfigurator $container) {
|
||||
->args([
|
||||
param('session.metadata.storage_key'),
|
||||
param('session.metadata.update_threshold'),
|
||||
param('session.metadata.cookie_lifetime'),
|
||||
]),
|
||||
])
|
||||
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
namespace Symfony\Bundle\FrameworkBundle\Test;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Config\Resource\SelfCheckingResourceChecker;
|
||||
use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Contracts\Service\ResetInterface;
|
||||
|
||||
@@ -38,6 +40,8 @@ abstract class KernelTestCase extends TestCase
|
||||
|
||||
protected static $booted = false;
|
||||
|
||||
private static bool $kernelHasBeenRebooted = false;
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
static::ensureKernelShutdown();
|
||||
@@ -88,6 +92,7 @@ abstract class KernelTestCase extends TestCase
|
||||
// reboot a fresh one.
|
||||
if ($kernel->getContainer()->initialized('cache_warmer')) {
|
||||
static::ensureKernelShutdown();
|
||||
self::$kernelHasBeenRebooted = true;
|
||||
|
||||
$kernel = static::createKernel($options);
|
||||
$kernel->boot();
|
||||
@@ -161,6 +166,20 @@ abstract class KernelTestCase extends TestCase
|
||||
static::$kernel->shutdown();
|
||||
static::$booted = false;
|
||||
|
||||
if (self::$kernelHasBeenRebooted) {
|
||||
self::$kernelHasBeenRebooted = false;
|
||||
try {
|
||||
(new \ReflectionProperty(Kernel::class, 'freshCache'))->setValue(null, []);
|
||||
} catch (\ReflectionException) {
|
||||
// ignore if the property doesn't exist
|
||||
}
|
||||
try {
|
||||
(new \ReflectionProperty(SelfCheckingResourceChecker::class, 'cache'))->setValue(null, []);
|
||||
} catch (\ReflectionException) {
|
||||
// ignore if the property doesn't exist
|
||||
}
|
||||
}
|
||||
|
||||
if ($container instanceof ResetInterface) {
|
||||
$container->reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user