You are here

function search_api_solr_update_helper_install_configs in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 search_api_solr.install \search_api_solr_update_helper_install_configs()
  2. 8.2 search_api_solr.install \search_api_solr_update_helper_install_configs()

Helper function to install all new configs.

Parameters

string $directory:

6 calls to search_api_solr_update_helper_install_configs()
search_api_solr_install_missing_field_types in ./search_api_solr.module
Re-install all default Solr Field Types from their yml files.
search_api_solr_legacy_update_8001 in modules/search_api_solr_legacy/search_api_solr_legacy.install
Install new field types for legacy Solr versions.
search_api_solr_post_update_8319 in ./search_api_solr.post_update.php
Install new Solr Field Types and uninstall search_api_solr_multilingual.
search_api_solr_update_8200 in ./search_api_solr.install
Install Solr Field Types.
search_api_solr_update_8331 in ./search_api_solr.install
Install Solr Cache, Request Handler, Request Dispatcher config entity types.

... See full list

File

./search_api_solr.install, line 383
Install, update and uninstall functions for the Search API Solr module.

Code

function search_api_solr_update_helper_install_configs($directory = InstallStorage::CONFIG_OPTIONAL_DIRECTORY) {

  /** @var \Drupal\Core\Config\ConfigInstallerInterface $config_installer */
  $config_installer = \Drupal::service('config.installer');
  $config_installer
    ->installDefaultConfig('module', 'search_api_solr');
  $optional_install_path = \Drupal::moduleHandler()
    ->getModule('search_api_solr')
    ->getPath() . '/' . $directory;
  if (is_dir($optional_install_path)) {

    // Install any optional config the module provides.
    $storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION);
    $config_installer
      ->installOptionalConfig($storage);
  }
  $restrict_by_dependency = [
    'module' => 'search_api_solr',
  ];
  $config_installer
    ->installOptionalConfig(NULL, $restrict_by_dependency);
}