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

Issue #2898561 by RajabNatshah, Mohammed J. Razem: Change Installation Steps: ...

Issue #2898561 by RajabNatshah, Mohammed J. Razem: Change Installation Steps:  Extra components, Development tools, Add Descriptions for modules/features in the [Extra Component] step, with forms for custom configurations
parent 31a8e2c6
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ class ConfigBit {
// Generate full path to config file
$full_config_bit_file_name = drupal_get_path($type, $project) . '/' . $config_bit_file_name;
if (is_file($full_config_bit_file_name)) {
if (file_exists($full_config_bit_file_name)) {
// Pars the config bit file and have it as an array if it was not.
$config_bit_data = (array) Yaml::parse(file_get_contents($full_config_bit_file_name));
if (isset($config_bit_data['config_bit'])) {
......@@ -126,8 +126,8 @@ class ConfigBit {
&& isset($config_bit_data['action']['archive_files']['files'])) {
foreach ($config_bit_data['action']['archive_files']['files'] as $language_config_file) {
$config_file = \Drupal::root() . $language_config_file;
if (is_file($config_file)) {
$config_file = drupal_get_path($type, $project) . '/' . $language_config_file;
if (file_exists($config_file)) {
$config_file_backup = $config_file . $config_bit_data['action']['archive_files']['archive_extensiton'];
file_unmanaged_move($config_file, $config_file_backup);
}
......@@ -157,9 +157,9 @@ class ConfigBit {
&& isset($config_bit_data['action']['unarchive_files']['files'])) {
foreach ($config_bit_data['action']['unarchive_files']['files'] as $language_config_file) {
$config_file = \Drupal::root() . $language_config_file;
$config_file = drupal_get_path($type, $project) . '/' . $language_config_file;
$config_file_backup = $config_file . $config_bit_data['action']['unarchive_files']['archive_extensiton'];
if (!is_file($config_file) && is_file($config_file_backup)) {
if (!file_exists($config_file) && file_exists($config_file_backup)) {
file_unmanaged_move($config_file_backup, $config_file);
}
}
......@@ -185,7 +185,7 @@ class ConfigBit {
&& $config_bit_data['type'] == 'action'
&& isset($config_bit_data['for'])
&& !empty($config_bit_data['for'])
&& is_file(\Drupal::root() . $config_bit_data['for'])
&& file_exists(drupal_get_path($type, $project) . '/' . $config_bit_data['for'])
&& isset($config_bit_data['action'])
&& isset($config_bit_data['action']['add'])
&& isset($config_bit_data['action']['add']['when'])
......@@ -195,7 +195,7 @@ class ConfigBit {
&& $config_bit_data['action']['add']['target'] == $target
&& isset($config_bit_data['action']['add'][$target])) {
$config_target_data = Yaml::parse(file_get_contents(\Drupal::root() . $config_bit_data['for']));
$config_target_data = Yaml::parse(file_get_contents(drupal_get_path($type, $project) . '/' . $config_bit_data['for']));
$configs_to_add = $config_bit_data['action']['add'][$target];
foreach ($configs_to_add as $config_to_add) {
......@@ -208,7 +208,7 @@ class ConfigBit {
$updated_config_target = Yaml::dump($config_target_data, 2, 2);
// Save the updated config to the target file.
file_put_contents(\Drupal::root() . $config_bit_data['for'], $updated_config_target);
file_put_contents(drupal_get_path($type, $project) . '/' . $config_bit_data['for'], $updated_config_target);
}
}
......@@ -232,7 +232,7 @@ class ConfigBit {
&& $config_bit_data['type'] == 'action'
&& isset($config_bit_data['for'])
&& $config_bit_data['for'] !== ''
&& is_file(\Drupal::root() . $config_bit_data['for'])
&& file_exists(drupal_get_path($type, $project) . '/' . $config_bit_data['for'])
&& isset($config_bit_data['action'])
&& isset($config_bit_data['action']['remove'])
&& isset($config_bit_data['action']['remove']['when'])
......@@ -243,7 +243,7 @@ class ConfigBit {
&& isset($config_bit_data['action']['remove'][$target])) {
// Read the Yaml config file. which this config bit for.
$config_target_data = Yaml::parse(file_get_contents(\Drupal::root() . $config_bit_data['for']));
$config_target_data = Yaml::parse(file_get_contents(drupal_get_path($type, $project) . '/' . $config_bit_data['for']));
$configs_to_remove = $config_bit_data['action']['remove'][$target];
foreach ($configs_to_remove as $config_to_remove) {
......@@ -257,7 +257,7 @@ class ConfigBit {
$updated_config_target = Yaml::dump($config_target_data, 2, 2);
// Save the updated config to the target file.
file_put_contents(\Drupal::root() . $config_bit_data['for'], $updated_config_target);
file_put_contents(drupal_get_path($type, $project) . '/' . $config_bit_data['for'], $updated_config_target);
}
}
......
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