3 namespace Drupal\webprofiler\Profiler;
5 use Drupal\Core\Config\ConfigFactoryInterface;
6 use Symfony\Component\DependencyInjection\ContainerInterface;
9 * Class ProfilerStorageFactory
11 class ProfilerStorageFactory {
14 * @param \Drupal\Core\Config\ConfigFactoryInterface $config
15 * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
17 * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
19 final public static function getProfilerStorage(ConfigFactoryInterface $config, ContainerInterface $container) {
20 $storage = $config->get('webprofiler.config')
21 ->get('storage') ?: 'profiler.database_storage';
23 return $container->get($storage);