lunr-8.x-1.0/src/LunrServiceProvider.php

src/LunrServiceProvider.php
<?php

namespace Drupal\lunr;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\lunr\EventSubscriber\TomePathSubscriber;
use Symfony\Component\DependencyInjection\Reference;

/**
 * Registers services in the container.
 */
class LunrServiceProvider implements ServiceProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function register(ContainerBuilder $container) {
    $modules = $container->getParameter('container.modules');
    if (isset($modules['tome_static'])) {
      $container->register('lunr.tome_path_subscriber', TomePathSubscriber::class)
        ->addTag('event_subscriber')
        ->addArgument(new Reference('entity_type.manager'))
        ->addArgument(new Reference('file_system'))
        ->addArgument(new Reference('file_url_generator'));
    }
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc