mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -20,6 +20,7 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ProfilerPass;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RemoveUnusedSessionMarshallingHandlerPass;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TestServiceContainerRealRefPass;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TestServiceContainerWeakRefPass;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationUpdateCommandPass;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\UnusedTagsPass;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\VirtualRequestStackPass;
|
||||
use Symfony\Component\Cache\Adapter\ApcuAdapter;
|
||||
@@ -58,6 +59,7 @@ use Symfony\Component\Mime\DependencyInjection\AddMimeTypeGuesserPass;
|
||||
use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass;
|
||||
use Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass;
|
||||
use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass;
|
||||
use Symfony\Component\Runtime\SymfonyRuntime;
|
||||
use Symfony\Component\Scheduler\DependencyInjection\AddScheduleMessengerPass;
|
||||
use Symfony\Component\Serializer\DependencyInjection\SerializerPass;
|
||||
use Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass;
|
||||
@@ -99,13 +101,19 @@ class FrameworkBundle extends Bundle
|
||||
{
|
||||
$_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger';
|
||||
|
||||
$handler = ErrorHandler::register(null, false);
|
||||
if (class_exists(SymfonyRuntime::class)) {
|
||||
$handler = set_error_handler('var_dump');
|
||||
restore_error_handler();
|
||||
} else {
|
||||
$handler = [ErrorHandler::register(null, false)];
|
||||
}
|
||||
|
||||
// When upgrading an existing Symfony application from 6.2 to 6.3, and
|
||||
// the cache is warmed up, the service is not available yet, so we need
|
||||
// to check if it exists.
|
||||
if ($this->container->has('debug.error_handler_configurator')) {
|
||||
$this->container->get('debug.error_handler_configurator')->configure($handler);
|
||||
if (!$this->container->has('debug.error_handler_configurator')) {
|
||||
// When upgrading an existing Symfony application from 6.2 to 6.3, and
|
||||
// the cache is warmed up, the service is not available yet, so we need
|
||||
// to check if it exists.
|
||||
} elseif (\is_array($handler) && $handler[0] instanceof ErrorHandler) {
|
||||
$this->container->get('debug.error_handler_configurator')->configure($handler[0]);
|
||||
}
|
||||
|
||||
if ($this->container->getParameter('kernel.http_method_override')) {
|
||||
@@ -186,6 +194,7 @@ class FrameworkBundle extends Bundle
|
||||
// must be registered after MonologBundle's LoggerChannelPass
|
||||
$container->addCompilerPass(new ErrorLoggerCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
|
||||
$container->addCompilerPass(new VirtualRequestStackPass());
|
||||
$container->addCompilerPass(new TranslationUpdateCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
|
||||
|
||||
if ($container->getParameter('kernel.debug')) {
|
||||
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 2);
|
||||
|
||||
Reference in New Issue
Block a user