You are here

class ServiceContainerSymfonyServiceProvider in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/src/ServiceContainer/ServiceProvider/ServiceContainerSymfonyServiceProvider.php \Drupal\service_container_symfony\ServiceContainer\ServiceProvider\ServiceContainerSymfonyServiceProvider

Provides render cache service definitions.

@codeCoverageIgnore

Hierarchy

Expanded class hierarchy of ServiceContainerSymfonyServiceProvider

File

modules/providers/service_container_symfony/src/ServiceContainer/ServiceProvider/ServiceContainerSymfonyServiceProvider.php, line 22
Contains \Drupal\service_container_symfony\ServiceContainer\ServiceProvider\ServiceContainerSymfonyServiceProvider

Namespace

Drupal\service_container_symfony\ServiceContainer\ServiceProvider
View source
class ServiceContainerSymfonyServiceProvider implements ServiceProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function getContainerDefinition() {
    FileCacheFactory::setConfiguration(array(
      'default' => array(
        'class' => '\\Drupal\\Component\\FileCache\\NullFileCache',
      ),
    ));
    $container_builder = new ContainerBuilder();
    $yaml_loader = new YamlFileLoader($container_builder);
    foreach (module_list() as $module) {
      $filename = drupal_get_filename('module', $module);
      $services = dirname($filename) . '/' . $module . '.services.yml';
      if (file_exists($services)) {
        $yaml_loader
          ->load($services);
      }
    }

    // Disabled for now.
    // $container_builder->compile();
    $dumper = new PhpArrayDumper($container_builder);
    return $dumper
      ->getArray();
  }

  /**
   * {@inheritdoc}
   */
  public function alterContainerDefinition(&$container_definition) {
  }

}

Members