public static function ConfigBit::actionUnArchiveFiles in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.4
Same name and namespace in other branches
- 8.8 src/Config/ConfigBit.php \Drupal\varbase\Config\ConfigBit::actionUnArchiveFiles()
- 8.5 src/Config/ConfigBit.php \Drupal\varbase\config\ConfigBit::actionUnArchiveFiles()
- 8.6 src/Config/ConfigBit.php \Drupal\varbase\config\ConfigBit::actionUnArchiveFiles()
- 8.7 src/Config/ConfigBit.php \Drupal\varbase\config\ConfigBit::actionUnArchiveFiles()
- 9.0.x src/Config/ConfigBit.php \Drupal\varbase\Config\ConfigBit::actionUnArchiveFiles()
Applay the action of Un archive files to the given config bit file.
Parameters
string $config_bit_file_name: Config bit file name in the root configbit folder.
string $condition_name: Condition name in the config bit file.
string|bool $condition_value: Condition value for the condition name in the config bit file.
File
- src/
Config/ ConfigBit.php, line 145
Class
- ConfigBit
- Defines config bit to help in managing custom config which used in install.
Namespace
Drupal\varbase\configCode
public static function actionUnArchiveFiles($config_bit_file_name, $condition_name, $condition_value, $type = 'profile', $project = 'varbase') {
$config_bit_data = ConfigBit::getConfigBit($config_bit_file_name, $type, $project);
if (isset($config_bit_data['type']) && ($config_bit_data['type'] = 'action' && isset($config_bit_data['action']) && isset($config_bit_data['action']['unarchive_files']) && isset($config_bit_data['action']['unarchive_files']['when']) && isset($config_bit_data['action']['unarchive_files']['when'][$condition_name]) && $config_bit_data['action']['unarchive_files']['when'][$condition_name] == $condition_value && isset($config_bit_data['action']['unarchive_files']['files']))) {
foreach ($config_bit_data['action']['unarchive_files']['files'] as $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 (!file_exists($config_file) && file_exists($config_file_backup)) {
file_unmanaged_move($config_file_backup, $config_file);
}
}
}
}