Skip to content

Commit 7201648

Browse files
committed
scrub varnish 4/5 references
Varnish 6.0 is half a decade old. 4.x and 5.x have been EOL'd years ago and there shouldn't be any more distribution carrying those, there's no good reason to keep them around
1 parent bc1c7ba commit 7201648

File tree

12 files changed

+8
-113
lines changed

12 files changed

+8
-113
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function getOptionList()
192192
null,
193193
InputOption::VALUE_REQUIRED,
194194
'The version of Varnish file',
195-
VclTemplateLocator::VARNISH_SUPPORTED_VERSION_4
195+
VclTemplateLocator::VARNISH_SUPPORTED_VERSION_6
196196
),
197197
new InputOption(
198198
self::GRACE_PERIOD_OPTION,

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ class Config
5656
*/
5757
public const VARNISH_6_CONFIGURATION_PATH = 'system/full_page_cache/varnish6/path';
5858

59-
/**
60-
* XML path to Varnish 5 config template path
61-
*/
62-
public const VARNISH_5_CONFIGURATION_PATH = 'system/full_page_cache/varnish5/path';
63-
64-
/**
65-
* XML path to Varnish 4 config template path
66-
*/
67-
public const VARNISH_4_CONFIGURATION_PATH = 'system/full_page_cache/varnish4/path';
68-
6959
/**
7060
* @var \Magento\Framework\App\Cache\StateInterface $_cacheState
7161
*/
@@ -153,11 +143,8 @@ public function getVclFile($vclTemplatePath)
153143
case self::VARNISH_6_CONFIGURATION_PATH:
154144
$version = 6;
155145
break;
156-
case self::VARNISH_5_CONFIGURATION_PATH:
157-
$version = 5;
158-
break;
159146
default:
160-
$version = 4;
147+
$version = 6;
161148
}
162149
$sslOffloadedHeader = $this->_scopeConfig->getValue(
163150
Request::XML_PATH_OFFLOADER_HEADER

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

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,10 @@
1919
class VclTemplateLocator implements VclTemplateLocatorInterface
2020
{
2121
/**
22-
* XML path to Varnish 5 config template path
22+
* XML path to Varnish 6 config template path
2323
*/
2424
const VARNISH_6_CONFIGURATION_PATH = 'system/full_page_cache/varnish6/path';
2525

26-
/**
27-
* XML path to Varnish 5 config template path
28-
*/
29-
const VARNISH_5_CONFIGURATION_PATH = 'system/full_page_cache/varnish5/path';
30-
31-
/**
32-
* XML path to Varnish 4 config template path
33-
*/
34-
const VARNISH_4_CONFIGURATION_PATH = 'system/full_page_cache/varnish4/path';
35-
36-
/**
37-
* Varnish 4 supported version
38-
*/
39-
const VARNISH_SUPPORTED_VERSION_4 = '4';
40-
41-
/**
42-
* Varnish 5 supported version
43-
*/
44-
const VARNISH_SUPPORTED_VERSION_5 = '5';
45-
4626
/**
4727
* Varnish 6 supported version
4828
*/
@@ -52,8 +32,6 @@ class VclTemplateLocator implements VclTemplateLocatorInterface
5232
* @var array
5333
*/
5434
private $supportedVarnishVersions = [
55-
self::VARNISH_SUPPORTED_VERSION_4 => self::VARNISH_4_CONFIGURATION_PATH,
56-
self::VARNISH_SUPPORTED_VERSION_5 => self::VARNISH_5_CONFIGURATION_PATH,
5735
self::VARNISH_SUPPORTED_VERSION_6 => self::VARNISH_6_CONFIGURATION_PATH,
5836
];
5937

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
<caching_application>1</caching_application>
2822
<default>

0 commit comments

Comments
 (0)