profiling.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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\EventListener\ProfilerListener;
  12. use Symfony\Component\HttpKernel\Profiler\FileProfilerStorage;
  13. use Symfony\Component\HttpKernel\Profiler\Profiler;
  14. return static function (ContainerConfigurator $container) {
  15. $container->services()
  16. ->set('profiler', Profiler::class)
  17. ->public()
  18. ->args([service('profiler.storage'), service('logger')->nullOnInvalid()])
  19. ->tag('monolog.logger', ['channel' => 'profiler'])
  20. ->set('profiler.storage', FileProfilerStorage::class)
  21. ->args([param('profiler.storage.dsn')])
  22. ->set('profiler_listener', ProfilerListener::class)
  23. ->args([
  24. service('profiler'),
  25. service('request_stack'),
  26. null,
  27. param('profiler_listener.only_exceptions'),
  28. param('profiler_listener.only_master_requests'),
  29. ])
  30. ->tag('kernel.event_subscriber')
  31. ;
  32. };