Update to Drupal 8.1.10. For more information, see https://www.drupal.org/project/drupal/releases/8.1.10
This commit is contained in:
parent
09b113657a
commit
2f563ab520
7 changed files with 151 additions and 12 deletions
|
@ -65,14 +65,17 @@ function config_file_download($uri) {
|
|||
$scheme = file_uri_scheme($uri);
|
||||
$target = file_uri_target($uri);
|
||||
if ($scheme == 'temporary' && $target == 'config.tar.gz') {
|
||||
$request = \Drupal::request();
|
||||
$date = DateTime::createFromFormat('U', $request->server->get('REQUEST_TIME'));
|
||||
$date_string = $date->format('Y-m-d-H-i');
|
||||
$hostname = str_replace('.', '-', $request->getHttpHost());
|
||||
$filename = 'config' . '-' . $hostname . '-' . $date_string . '.tar.gz';
|
||||
$disposition = 'attachment; filename="' . $filename . '"';
|
||||
return array(
|
||||
'Content-disposition' => $disposition,
|
||||
);
|
||||
if (\Drupal::currentUser()->hasPermission('export configuration')) {
|
||||
$request = \Drupal::request();
|
||||
$date = DateTime::createFromFormat('U', $request->server->get('REQUEST_TIME'));
|
||||
$date_string = $date->format('Y-m-d-H-i');
|
||||
$hostname = str_replace('.', '-', $request->getHttpHost());
|
||||
$filename = 'config' . '-' . $hostname . '-' . $date_string . '.tar.gz';
|
||||
$disposition = 'attachment; filename="' . $filename . '"';
|
||||
return array(
|
||||
'Content-disposition' => $disposition,
|
||||
);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue