Add filename in build archive response
modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderInterface.php
This commit is contained in:
@@ -236,7 +236,7 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
||||
*
|
||||
* This method return an instance of a Response with the archive as content.
|
||||
*/
|
||||
public function buildArchiveResponse()
|
||||
public function buildArchiveResponse($filename)
|
||||
{
|
||||
$this->tar->setMetadata("Generated by Thelia v" . Thelia::THELIA_VERSION);
|
||||
|
||||
@@ -262,6 +262,7 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
|
||||
200,
|
||||
[
|
||||
"Content-Type" => $this->getMimeType(),
|
||||
"Content-Disposition" => $filename . "." . $this->getExtension(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
||||
*
|
||||
* This method return an instance of a Response with the archive as content.
|
||||
*/
|
||||
public function buildArchiveResponse()
|
||||
public function buildArchiveResponse($filename)
|
||||
{
|
||||
$this->zip->comment = "Generated by Thelia v" . Thelia::THELIA_VERSION;
|
||||
|
||||
@@ -331,7 +331,8 @@ class ZipArchiveBuilder extends AbstractArchiveBuilder
|
||||
$content,
|
||||
200,
|
||||
[
|
||||
"Content-Type" => $this->getMimeType()
|
||||
"Content-Type" => $this->getMimeType(),
|
||||
"Content-Disposition" => $filename . "." . $this->getExtension(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -76,12 +76,14 @@ interface ArchiveBuilderInterface
|
||||
* This method creates an empty directory
|
||||
*/
|
||||
public function addDirectory($directoryPath);
|
||||
|
||||
/**
|
||||
* @params string $filename
|
||||
* @return \Thelia\Core\HttpFoundation\Response
|
||||
*
|
||||
* This method return an instance of a Response with the archive as content.
|
||||
*/
|
||||
public function buildArchiveResponse();
|
||||
public function buildArchiveResponse($filename);
|
||||
|
||||
/**
|
||||
* @param string $pathToArchive
|
||||
|
||||
Reference in New Issue
Block a user