Version 1
[yaffs-website] / web / modules / contrib / devel / webprofiler / src / Profiler / ProfilerStorageFactory.php
1 <?php
2
3 namespace Drupal\webprofiler\Profiler;
4
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Symfony\Component\DependencyInjection\ContainerInterface;
7
8 /**
9  * Class ProfilerStorageFactory
10  */
11 class ProfilerStorageFactory {
12
13   /**
14    * @param \Drupal\Core\Config\ConfigFactoryInterface $config
15    * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
16    *
17    * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
18    */
19   final public static function getProfilerStorage(ConfigFactoryInterface $config, ContainerInterface $container) {
20     $storage = $config->get('webprofiler.config')
21       ->get('storage') ?: 'profiler.database_storage';
22
23     return $container->get($storage);
24   }
25
26 }