You are here

PathautoServiceProvider.php in Pathauto 8

Namespace

Drupal\pathauto

File

src/PathautoServiceProvider.php
View source
<?php

namespace Drupal\pathauto;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

/**
 * Remove the drush commands until path_alias module is enabled.
 */
class PathautoServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function register(ContainerBuilder $container) {
    $definitions = array_keys($container
      ->getDefinitions());
    if (!in_array('path_alias.repository', $definitions)) {
      $container
        ->removeDefinition('pathauto.commands');
    }
  }

}

Classes

Namesort descending Description
PathautoServiceProvider Remove the drush commands until path_alias module is enabled.