- $current_storage_backend = DI::storage();
- $available_storage_backends = [];
-
- // show legacy option only if it is the current backend:
- // once changed can't be selected anymore
- if ($current_storage_backend == null) {
- $available_storage_backends[''] = DI::l10n()->t('Database (legacy)');
- }
-
- foreach (DI::storageManager()->listBackends() as $name => $class) {
- $available_storage_backends[$name] = $name;
- }
-
- // build storage config form,
- $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|' ,'', $current_storage_backend);
-
- $storage_form = [];
- if (!is_null($current_storage_backend) && $current_storage_backend != '') {
- foreach ($current_storage_backend->getOptions() as $name => $info) {
- $type = $info[0];
- // Backward compatibilty with yesno field description
- if ($type == 'yesno') {
- $type = 'checkbox';
- // Remove translated labels Yes No from field info
- unset($info[4]);
- }
-
- $info[0] = $storage_form_prefix . '_' . $name;
- $info['type'] = $type;
- $info['field'] = 'field_' . $type . '.tpl';
- $storage_form[$name] = $info;
- }
- }
-
- if (function_exists('proc_open')) {
- $worker_dont_fork = DI::config()->get('system', 'worker_dont_fork');
- $worker_dont_fork_disabled = '';
- } else {
- $worker_dont_fork = true;
- $worker_dont_fork_disabled = 'disabled';
- }
-