Form submission handler.
array $form: An associative array containing the structure of the form.
array $form_state: An associative array containing the current state of the form.
Overrides FormInterface::submitForm
public function submitForm(array &$form, array &$form_state) {
if ($path = $form_state['values']['import_tarball']) {
\Drupal::service('config.storage.staging')
->deleteAll();
$archiver = new ArchiveTar($path, 'gz');
$files = array();
foreach ($archiver
->listContent() as $file) {
$files[] = $file['filename'];
}
$archiver
->extractList($files, config_get_config_directory(CONFIG_STAGING_DIRECTORY));
drupal_unlink($path);
drupal_set_message('Your configuration files were successfully uploaded, ready for import.');
$form_state['redirect'] = 'admin/config/development/sync';
}
}