File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed
Backup/Controller/Adminhtml/Index
ImportExport/Controller/Adminhtml/History
Wishlist/Controller/Index Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
namespace Magento \Backup \Controller \Adminhtml \Index ;
8
8
9
+ use Magento \Framework \App \Action \HttpGetActionInterface ;
9
10
use Magento \Framework \App \Filesystem \DirectoryList ;
10
11
11
- class Download extends \Magento \Backup \Controller \Adminhtml \Index
12
+ class Download extends \Magento \Backup \Controller \Adminhtml \Index implements HttpGetActionInterface
12
13
{
13
14
/**
14
15
* @var \Magento\Framework\Controller\Result\RawFactory
@@ -66,17 +67,12 @@ public function execute()
66
67
67
68
$ fileName = $ this ->_objectManager ->get (\Magento \Backup \Helper \Data::class)->generateBackupDownloadName ($ backup );
68
69
69
- $ this ->_fileFactory ->create (
70
+ return $ this ->_fileFactory ->create (
70
71
$ fileName ,
71
- null ,
72
+ $ backup -> output () ,
72
73
DirectoryList::VAR_DIR ,
73
74
'application/octet-stream ' ,
74
75
$ backup ->getSize ()
75
76
);
76
-
77
- /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
78
- $ resultRaw = $ this ->resultRawFactory ->create ();
79
- $ resultRaw ->setContents ($ backup ->output ());
80
- return $ resultRaw ;
81
77
}
82
78
}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public function __construct(
47
47
*/
48
48
public function execute ()
49
49
{
50
+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
50
51
$ fileName = basename ($ this ->getRequest ()->getParam ('filename ' ));
51
52
52
53
/** @var \Magento\ImportExport\Helper\Report $reportHelper */
@@ -59,17 +60,12 @@ public function execute()
59
60
return $ resultRedirect ;
60
61
}
61
62
62
- $ this ->fileFactory ->create (
63
+ return $ this ->fileFactory ->create (
63
64
$ fileName ,
64
- null ,
65
+ $ reportHelper -> getReportOutput ( $ fileName ) ,
65
66
DirectoryList::VAR_IMPORT_EXPORT ,
66
67
'application/octet-stream ' ,
67
68
$ reportHelper ->getReportSize ($ fileName )
68
69
);
69
-
70
- /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
71
- $ resultRaw = $ this ->resultRawFactory ->create ();
72
- $ resultRaw ->setContents ($ reportHelper ->getReportOutput ($ fileName ));
73
- return $ resultRaw ;
74
70
}
75
71
}
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public function execute()
97
97
$ secretKey = $ this ->getRequest ()->getParam ('key ' );
98
98
99
99
if ($ secretKey == $ info ['secret_key ' ]) {
100
- $ this ->_fileResponseFactory ->create (
100
+ return $ this ->_fileResponseFactory ->create (
101
101
$ info ['title ' ],
102
102
['value ' => $ info ['quote_path ' ], 'type ' => 'filename ' ],
103
103
DirectoryList::MEDIA ,
You can’t perform that action at this time.
0 commit comments