Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-media-storage
Model
File
Storage
Response.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\MediaStorage\Model\File\Storage
;
7
8
use
Magento\Framework\App\Response\Http
;
9
use
Magento\Framework\App\Request\Http
as HttpRequest;
10
use
Magento\Framework\Stdlib\Cookie\CookieMetadataFactory
;
11
use
Magento\Framework\Stdlib\CookieManagerInterface
;
12
13
class
Response
extends
Http
implements
14
\Magento\Framework\App\Response\FileInterface
,
15
\Magento\Framework\App\PageCache\NotCacheableInterface
16
{
20
protected
$_transferAdapter
;
21
27
protected
$_filePath
;
28
39
public
function
__construct
(
40
HttpRequest
$request
,
41
CookieManagerInterface
$cookieManager
,
42
CookieMetadataFactory
$cookieMetadataFactory
,
43
\
Magento
\Framework\
App
\
Http
\
Context
$context
,
44
\
Magento
\Framework\Stdlib\DateTime
$dateTime
,
45
\
Magento
\Framework\
File
\Transfer\Adapter\
Http
$transferAdapter
46
) {
47
parent::__construct(
$request
,
$cookieManager
,
$cookieMetadataFactory
,
$context
,
$dateTime
);
48
$this->_transferAdapter = $transferAdapter;
49
}
50
56
public
function
sendResponse
()
57
{
58
if
($this->_filePath && $this->
getHttpResponseCode
() == 200) {
59
$options
= [
60
'filepath'
=>
$this->_filePath
,
61
'headers'
=> $this->getHeaders(),
62
];
63
$this->_transferAdapter->send(
$options
);
64
}
else
{
65
parent::sendResponse();
66
}
67
}
68
73
public
function
setFilePath
(
$path
)
74
{
75
$this->_filePath =
$path
;
76
}
77
}
Magento\Framework\App\Response\Http
Definition:
FileFactory.php:7
Magento\Framework\App
Magento\Framework\App\Response\Http\$cookieMetadataFactory
$cookieMetadataFactory
Definition:
Http.php:43
Magento\Framework\App\Response\Http\$request
$request
Definition:
Http.php:33
Magento\Framework\App\Response\Http\$cookieManager
$cookieManager
Definition:
Http.php:38
Magento\Framework\App\Response\Http
Definition:
Http.php:19
Magento\Framework\App\Response\HttpInterface\getHttpResponseCode
getHttpResponseCode()
Magento\MediaStorage\Model\File\Storage\Response\$_filePath
$_filePath
Definition:
Response.php:27
Magento\Framework\App\Response\FileInterface
Definition:
FileInterface.php:14
Magento\Framework\Stdlib\CookieManagerInterface
Definition:
CookieManagerInterface.php:27
Magento\Framework\App\Request\Http
Definition:
Http.php:20
Magento\MediaStorage\Model\File\Storage\File
Definition:
File.php:14
Magento\Framework\App\Response\Http\$context
$context
Definition:
Http.php:48
Magento\MediaStorage\Model\File\Storage
Definition:
ResponseTest.php:8
Magento\MediaStorage\Model\File\Storage\Response\sendResponse
sendResponse()
Definition:
Response.php:56
Magento
Magento\Framework\App\Response\Http\$dateTime
$dateTime
Definition:
Http.php:53
Magento\Framework\Stdlib\Cookie\CookieMetadataFactory
Definition:
CookieMetadataFactory.php:16
Magento\MediaStorage\Model\File\Storage\Response\$_transferAdapter
$_transferAdapter
Definition:
Response.php:20
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\MediaStorage\Model\File\Storage\Response\__construct
__construct(HttpRequest $request, CookieManagerInterface $cookieManager, CookieMetadataFactory $cookieMetadataFactory, \Magento\Framework\App\Http\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\File\Transfer\Adapter\Http $transferAdapter)
Definition:
Response.php:39
Magento\Framework\App\PageCache\NotCacheableInterface
Definition:
NotCacheableInterface.php:14
$options
$options
Definition:
multiple_mixed_products.php:29
$path
$path
Definition:
import_with_filesystem_images.php:14
Magento\MediaStorage\Model\File\Storage\Response\setFilePath
setFilePath($path)
Definition:
Response.php:73