![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/demo.intellicart.co/vendor/symfony/http-kernel/DependencyInjection/ |
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\DependencyInjection; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Log\Logger; /** * Registers the default logger if necessary. * * @author Kévin Dunglas <[email protected]> */ class LoggerPass implements CompilerPassInterface { /** * @return void */ public function process(ContainerBuilder $container) { $container->setAlias(LoggerInterface::class, 'logger'); if ($container->has('logger')) { return; } if ($debug = $container->getParameter('kernel.debug')) { // Build an expression that will be equivalent to `!in_array(PHP_SAPI, ['cli', 'phpdbg'])` $debug = (new Definition('bool')) ->setFactory('in_array') ->setArguments([ (new Definition('string'))->setFactory('constant')->setArguments(['PHP_SAPI']), ['cli', 'phpdbg'], ]); $debug = (new Definition('bool')) ->setFactory('in_array') ->setArguments([$debug, [false]]); } $container->register('logger', Logger::class) ->setArguments([null, null, null, new Reference(RequestStack::class), $debug]); } }