Skip to content
Snippets Groups Projects
Commit e9766f20 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3017555: Changed [Varbase] Components dependencies on install: enable...

Issue #3017555: Changed [Varbase] Components dependencies on install: enable or dependencies: enable of modules in the .info.yml and composer.json to have tilde Version Range (~)
parent 528e85c9
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,6 @@ use Symfony\Component\Yaml\Yaml; ...@@ -9,7 +9,6 @@ use Symfony\Component\Yaml\Yaml;
use Drupal\Core\Config; use Drupal\Core\Config;
use Drupal\Core\Config\InstallStorage; use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface; use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Config\ExtensionInstallStorage;
use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\FileStorage;
use Drupal\user\Entity\User; use Drupal\user\Entity\User;
use Drupal\user\RoleInterface; use Drupal\user\RoleInterface;
...@@ -30,6 +29,15 @@ function varbase_install() { ...@@ -30,6 +29,15 @@ function varbase_install() {
// Install any optional config the profile provides. // Install any optional config the profile provides.
$storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION); $storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION);
$config_installer->installOptionalConfig($storage, ''); $config_installer->installOptionalConfig($storage, '');
// Have the .settings.yml configs into the active config.
$settings_config_files = file_scan_directory($optional_install_path, '/^.*\\.(settings.yml)$/i');
$settings_config_filenames = array();
foreach ($settings_config_files as $settings_config_file) {
$settings_config_file_content = file_get_contents(DRUPAL_ROOT . '/' . $settings_config_file->uri);
$settings_config_file_data = (array) Yaml::parse($settings_config_file_content);
$config_factory = \Drupal::configFactory()->getEditable($settings_config_file->name);
$config_factory->setData($settings_config_file_data)->save(TRUE);
}
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment