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-page-cache
Controller
Adminhtml
PageCache
ExportVarnishConfig.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\PageCache\Controller\Adminhtml\PageCache
;
8
9
use
Magento\Framework\App\Filesystem\DirectoryList
;
10
11
class
ExportVarnishConfig
extends
\Magento\Backend\App\Action
12
{
16
const
ADMIN_RESOURCE
=
'Magento_Backend::system'
;
17
21
protected
$fileFactory
;
22
26
protected
$config
;
27
33
public
function
__construct
(
34
\
Magento
\Backend\
App
\Action\
Context
$context,
35
\
Magento
\Framework\
App
\
Response
\Http\FileFactory
$fileFactory
,
36
\
Magento
\PageCache\Model\Config
$config
37
) {
38
parent::__construct($context);
39
$this->config =
$config
;
40
$this->fileFactory =
$fileFactory
;
41
}
42
48
public
function
execute
()
49
{
50
$fileName
=
'varnish.vcl'
;
51
$varnishVersion = $this->
getRequest
()->getParam(
'varnish'
);
52
switch
($varnishVersion) {
53
case
5:
54
$content
= $this->config->getVclFile(\
Magento
\PageCache\Model\Config::VARNISH_5_CONFIGURATION_PATH);
55
break
;
56
default
:
57
$content
= $this->config->getVclFile(\
Magento
\PageCache\Model\Config::VARNISH_4_CONFIGURATION_PATH);
58
break
;
59
}
60
return
$this->fileFactory->create(
$fileName
,
$content
,
DirectoryList::VAR_DIR
);
61
}
62
}
Magento\Framework\App\Response\Http
Definition:
FileFactory.php:7
Magento\Framework\App
Magento\Framework\App\Filesystem\DirectoryList\VAR_DIR
const VAR_DIR
Definition:
DirectoryList.php:58
Magento\PageCache\Controller\Adminhtml\PageCache\ExportVarnishConfig\__construct
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\PageCache\Model\Config $config)
Definition:
ExportVarnishConfig.php:33
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\PageCache\Controller\Adminhtml\PageCache\ExportVarnishConfig
Definition:
ExportVarnishConfig.php:11
$fileName
$fileName
Definition:
translate.phtml:15
Magento\Backend\App\Action
Definition:
Action.php:17
Magento
Magento\PageCache\Controller\Adminhtml\PageCache\ExportVarnishConfig\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
ExportVarnishConfig.php:16
Magento\Framework\App\Filesystem\DirectoryList
Definition:
DirectoryList.php:13
$content
$content
Definition:
downloadable_product_with_files_and_sample_url.php:93
Magento\PageCache\Controller\Adminhtml\PageCache
Definition:
ExportVarnishConfig.php:7
Magento\PageCache\Controller\Adminhtml\PageCache\ExportVarnishConfig\$config
$config
Definition:
ExportVarnishConfig.php:26
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\PageCache\Controller\Adminhtml\PageCache\ExportVarnishConfig\$fileFactory
$fileFactory
Definition:
ExportVarnishConfig.php:21
Magento\PageCache\Controller\Adminhtml\PageCache\ExportVarnishConfig\execute
execute()
Definition:
ExportVarnishConfig.php:48