You are here

public function ConfigurationManager::registerHandlers in Configuration Management 7.3

File

src/ConfigurationManager.php, line 53

Class

ConfigurationManager

Namespace

Configuration

Code

public function registerHandlers() {
  $this->handlers
    ->set('content_type', new ContentTypeConfigurationHandler('content_type', $this));
  $this->handlers
    ->set('field_instance', new FieldInstanceConfigurationHandler('field_instance', $this));
  $this->handlers
    ->set('field_base', new FieldBaseConfigurationHandler('field_base', $this));
  $this->handlers
    ->set('variable', new VariableConfigurationHandler('variable', $this));
  $this->handlers
    ->set('permission', new PermissionConfigurationHandler('permission', $this));
  $this->handlers
    ->set('role', new RoleConfigurationHandler('role', $this));
  $this->handlers
    ->set('text_format', new TextFormatConfigurationHandler('text_format', $this));
  if (module_exists('image')) {
    $this->handlers
      ->set('image_style', new \Configuration\Handlers\ImageStyleConfigurationHandler('image_style', $this));
  }
  if (module_exists('locale')) {
    $this->handlers
      ->set('language', new \Configuration\Handlers\LanguageConfigurationHandler('language', $this));
  }
  if (module_exists('menu')) {
    $this->handlers
      ->set('menu', new \Configuration\Handlers\MenuConfigurationHandler('menu', $this));
  }
  if (module_exists('taxonomy')) {
    $this->handlers
      ->set('vocabulary', new \Configuration\Handlers\VocabularyConfigurationHandler('vocabulary', $this));
  }
  if (module_exists('views')) {
    $this->handlers
      ->set('view', new \Configuration\Handlers\ViewConfigurationHandler('view', $this));
  }
  if (module_exists('wysiwyg')) {
    $this->handlers
      ->set('wysiwyg', new \Configuration\Handlers\WysiwygConfigurationHandler('wysiwyg', $this));
  }
  if (module_exists('entity')) {
    foreach (\Configuration\Handlers\EntityConfigurationHandler::getSupportedTypes() as $entity_type) {
      $this->handlers
        ->set($entity_type, new \Configuration\Handlers\EntityConfigurationHandler($entity_type, $this));
    }
  }

  // Register Metadata Proccesor due it is not handler specific.
  foreach (\Configuration\Processors\MetadataProcessor::availableProcessors() as $name) {
    $processor = new \Configuration\Processors\MetadataProcessor($name, $this);
    $this
      ->registerProcessor($name, $processor);
  }
  return $this;
}