debug_prod.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
  12. use Symfony\Component\HttpKernel\EventListener\DebugHandlersListener;
  13. return static function (ContainerConfigurator $container) {
  14. $container->parameters()->set('debug.error_handler.throw_at', -1);
  15. $container->services()
  16. ->set('debug.debug_handlers_listener', DebugHandlersListener::class)
  17. ->args([
  18. null, // Exception handler
  19. service('monolog.logger.php')->nullOnInvalid(),
  20. null, // Log levels map for enabled error levels
  21. param('debug.error_handler.throw_at'),
  22. param('kernel.debug'),
  23. service('debug.file_link_formatter'),
  24. param('kernel.debug'),
  25. service('monolog.logger.deprecation')->nullOnInvalid(),
  26. ])
  27. ->tag('kernel.event_subscriber')
  28. ->tag('monolog.logger', ['channel' => 'php'])
  29. ->set('debug.file_link_formatter', FileLinkFormatter::class)
  30. ->args([param('debug.file_link_format')])
  31. ->alias(FileLinkFormatter::class, 'debug.file_link_formatter')
  32. ;
  33. };