Skip to content

Commit 4ce4490

Browse files
Indrani SonawaneIndrani Sonawane
authored andcommitted
Resolved conflict while merging 38052
2 parents 9141fe5 + f991baf commit 4ce4490

File tree

12 files changed

+31
-91
lines changed

12 files changed

+31
-91
lines changed

app/code/Magento/CacheInvalidate/Model/PurgeCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ class PurgeCache
3737
/**
3838
* Batch size of the purge request.
3939
*
40-
* Based on default Varnish 4 http_req_hdr_len size minus a 512 bytes margin for method,
40+
* Based on default Varnish 6 http_req_hdr_len size minus a 512 bytes margin for method,
4141
* header name, line feeds etc.
4242
*
43-
* @see https://varnish-cache.org/docs/4.1/reference/varnishd.html
43+
* @see https://varnish-cache.org/docs/6.0/reference/varnishd.html
4444
*
4545
* @var int
4646
*/

app/code/Magento/PageCache/Block/System/Config/Form/Field/Export/Varnish4.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/code/Magento/PageCache/Block/System/Config/Form/Field/Export/Varnish5.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/code/Magento/PageCache/Console/Command/GenerateVclCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private function getOptionList()
197197
null,
198198
InputOption::VALUE_REQUIRED,
199199
'The version of Varnish file',
200-
VclTemplateLocator::VARNISH_SUPPORTED_VERSION_4
200+
VclTemplateLocator::VARNISH_SUPPORTED_VERSION_6
201201
),
202202
new InputOption(
203203
self::GRACE_PERIOD_OPTION,
@@ -222,7 +222,7 @@ private function getOptionList()
222222
}
223223

224224
/**
225-
* Input vcl params
225+
* Maps input keys to vcl parameters
226226
*
227227
* @param InputInterface $input
228228
* @return array

app/code/Magento/PageCache/Controller/Adminhtml/PageCache/ExportVarnishConfig.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ExportVarnishConfig extends \Magento\Backend\App\Action implements HttpGet
1616
/**
1717
* Authorization level of a basic admin session
1818
*/
19-
const ADMIN_RESOURCE = 'Magento_Backend::system';
19+
public const ADMIN_RESOURCE = 'Magento_Backend::system';
2020

2121
/**
2222
* @var \Magento\Backend\App\Response\Http\FileFactory
@@ -56,11 +56,8 @@ public function execute()
5656
case 6:
5757
$content = $this->config->getVclFile(\Magento\PageCache\Model\Config::VARNISH_6_CONFIGURATION_PATH);
5858
break;
59-
case 5:
60-
$content = $this->config->getVclFile(\Magento\PageCache\Model\Config::VARNISH_5_CONFIGURATION_PATH);
61-
break;
6259
default:
63-
$content = $this->config->getVclFile(\Magento\PageCache\Model\Config::VARNISH_4_CONFIGURATION_PATH);
60+
$content = $this->config->getVclFile(\Magento\PageCache\Model\Config::VARNISH_6_CONFIGURATION_PATH);
6461
break;
6562
}
6663
return $this->fileFactory->create($fileName, $content, DirectoryList::VAR_DIR);

app/code/Magento/PageCache/Model/Config.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@ class Config
5757
public const VARNISH_6_CONFIGURATION_PATH = 'system/full_page_cache/varnish6/path';
5858

5959
/**
60+
* @deprecated Varnish 5 is EOL
61+
* @see VARNISH_6_CONFIGURATION_PATH
6062
* XML path to Varnish 5 config template path
6163
*/
6264
public const VARNISH_5_CONFIGURATION_PATH = 'system/full_page_cache/varnish5/path';
6365

6466
/**
67+
* @deprecated Varnish 4 is EOL
68+
* @see VARNISH_6_CONFIGURATION_PATH
6569
* XML path to Varnish 4 config template path
6670
*/
6771
public const VARNISH_4_CONFIGURATION_PATH = 'system/full_page_cache/varnish4/path';
@@ -140,7 +144,8 @@ public function getTtl()
140144
*
141145
* @param string $vclTemplatePath
142146
* @return string
143-
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
147+
* @deprecated 100.2.0
148+
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
144149
*/
145150
public function getVclFile($vclTemplatePath)
146151
{
@@ -153,11 +158,8 @@ public function getVclFile($vclTemplatePath)
153158
case self::VARNISH_6_CONFIGURATION_PATH:
154159
$version = 6;
155160
break;
156-
case self::VARNISH_5_CONFIGURATION_PATH:
157-
$version = 5;
158-
break;
159161
default:
160-
$version = 4;
162+
$version = 6;
161163
}
162164
$sslOffloadedHeader = $this->_scopeConfig->getValue(
163165
Request::XML_PATH_OFFLOADER_HEADER
@@ -179,7 +181,8 @@ public function getVclFile($vclTemplatePath)
179181
* Prepare data for VCL config
180182
*
181183
* @return array
182-
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
184+
* @deprecated 100.2.0
185+
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
183186
*/
184187
protected function _getReplacements()
185188
{
@@ -209,7 +212,8 @@ protected function _getReplacements()
209212
* }
210213
*
211214
* @return mixed|null|string
212-
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
215+
* @deprecated 100.2.0
216+
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
213217
*/
214218
protected function _getAccessList()
215219
{
@@ -235,7 +239,8 @@ protected function _getAccessList()
235239
* we have to convert "/pattern/iU" into "(?Ui)pattern"
236240
*
237241
* @return string
238-
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
242+
* @deprecated 100.2.0
243+
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
239244
*/
240245
protected function _getDesignExceptions()
241246
{

app/code/Magento/PageCache/Model/Varnish/VclTemplateLocator.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,46 @@
2020
class VclTemplateLocator implements VclTemplateLocatorInterface
2121
{
2222
/**
23-
* XML path to Varnish 5 config template path
23+
* XML path to Varnish 6 config template path
2424
*/
2525
public const VARNISH_6_CONFIGURATION_PATH = 'system/full_page_cache/varnish6/path';
2626

2727
/**
28+
* @deprecated Varnish 5 is EOL
29+
* @see VARNISH_6_CONFIGURATION_PATH
2830
* XML path to Varnish 5 config template path
2931
*/
3032
public const VARNISH_5_CONFIGURATION_PATH = 'system/full_page_cache/varnish5/path';
3133

3234
/**
35+
* @deprecated Varnish 4 is EOL
36+
* @see VARNISH_6_CONFIGURATION_PATH
3337
* XML path to Varnish 4 config template path
3438
*/
3539
public const VARNISH_4_CONFIGURATION_PATH = 'system/full_page_cache/varnish4/path';
3640

3741
/**
38-
* Varnish 4 supported version
42+
* @deprecated Varnish 4 is EOL
43+
* @see VARNISH_SUPPORTED_VERSION_6
3944
*/
4045
public const VARNISH_SUPPORTED_VERSION_4 = '4';
4146

4247
/**
43-
* Varnish 5 supported version
48+
* @deprecated Varnish 5 is EOL
49+
* @see VARNISH_SUPPORTED_VERSION_6
4450
*/
4551
public const VARNISH_SUPPORTED_VERSION_5 = '5';
4652

4753
/**
4854
* Varnish 6 supported version
55+
* @see VARNISH_SUPPORTED_VERSION_6
4956
*/
5057
public const VARNISH_SUPPORTED_VERSION_6 = '6';
5158

5259
/**
5360
* @var array
5461
*/
5562
private $supportedVarnishVersions = [
56-
self::VARNISH_SUPPORTED_VERSION_4 => self::VARNISH_4_CONFIGURATION_PATH,
57-
self::VARNISH_SUPPORTED_VERSION_5 => self::VARNISH_5_CONFIGURATION_PATH,
5863
self::VARNISH_SUPPORTED_VERSION_6 => self::VARNISH_6_CONFIGURATION_PATH,
5964
];
6065

app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function testGetVcl(): void
183183
->method('unserialize')
184184
->with('serializedConfig')
185185
->willReturn([['regexp' => '(?i)pattern', 'value' => 'value_for_pattern']]);
186-
$test = $this->config->getVclFile(Config::VARNISH_5_CONFIGURATION_PATH);
186+
$test = $this->config->getVclFile(Config::VARNISH_6_CONFIGURATION_PATH);
187187
$this->assertEquals(file_get_contents(__DIR__ . '/_files/result.vcl'), $test);
188188
}
189189

app/code/Magento/PageCache/etc/adminhtml/system.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@
4949
<field id="caching_application">1</field>
5050
</depends>
5151
</field>
52-
<field id="export_button_version4" translate="label" type="button" sortOrder="35" showInDefault="1">
53-
<label>Export Configuration</label>
54-
<frontend_model>Magento\PageCache\Block\System\Config\Form\Field\Export\Varnish4</frontend_model>
55-
<depends>
56-
<field id="caching_application">1</field>
57-
</depends>
58-
</field>
59-
<field id="export_button_version5" type="button" sortOrder="40" showInDefault="1">
60-
<frontend_model>Magento\PageCache\Block\System\Config\Form\Field\Export\Varnish5</frontend_model>
61-
<depends>
62-
<field id="caching_application">1</field>
63-
</depends>
64-
</field>
6552
<field id="export_button_version6" type="button" sortOrder="40" showInDefault="1">
6653
<frontend_model>Magento\PageCache\Block\System\Config\Form\Field\Export\Varnish6</frontend_model>
6754
<depends>

app/code/Magento/PageCache/etc/config.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
<varnish6>
1818
<path>varnish6.vcl</path>
1919
</varnish6>
20-
<varnish5>
21-
<path>varnish5.vcl</path>
22-
</varnish5>
23-
<varnish4>
24-
<path>varnish4.vcl</path>
25-
</varnish4>
2620
<ttl>86400</ttl>
2721
<handles_size>100</handles_size>
2822
<caching_application>1</caching_application>

0 commit comments

Comments
 (0)