Skip to content

Commit c4cf3c5

Browse files
committed
Fixed #63
1 parent ed63455 commit c4cf3c5

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

.magento.docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: magento-development
22
services:
33
php:
4-
version: "7.4"
4+
version: "8.1"
55
mysql:
66
version: "10.4"
77
elasticsearch:

Helper/Data.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,19 +159,19 @@ public function getVarnishServerConfigInfo () {
159159

160160
public function getExcludedRoutes () {
161161
$path = "jetrails_varnish/cache_exclusion_patterns/excluded_routes";
162-
$routes = explode ( "\n", $this->_getConfigValue ( $path ) );
162+
$routes = explode ( "\n", $this->_getConfigValue ( $path ) ?? "" );
163163
return array_filter ( $routes, function ( $i ) { return $i != ""; });
164164
}
165165

166166
public function getExcludedWildcardPatterns () {
167167
$path = "jetrails_varnish/cache_exclusion_patterns/excluded_wildcard_patterns";
168-
$routes = explode ( "\n", $this->_getConfigValue ( $path ) );
168+
$routes = explode ( "\n", $this->_getConfigValue ( $path ) ?? "" );
169169
return array_filter ( $routes, function ( $i ) { return $i != ""; });
170170
}
171171

172172
public function getExcludedRegExpPatterns () {
173173
$path = "jetrails_varnish/cache_exclusion_patterns/excluded_regexp_patterns";
174-
$routes = explode ( "\n", $this->_getConfigValue ( $path ) );
174+
$routes = explode ( "\n", $this->_getConfigValue ( $path ) ?? "" );
175175
return array_filter ( $routes, function ( $i ) { return $i != ""; });
176176
}
177177

Helper/VclGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ public function modifyRecv ( $node ) {
175175
$value = preg_replace (
176176
"/if\s*\(\s*!req.http.X-Magento-Tags-Pattern\s+&&\s+!req.http.X-Pool\s*\)\s*{/m",
177177
"if ( !req.http.X-Magento-Tags-Pattern && !req.http.X-Pool && !req.http.JR-Purge ) {",
178-
$value,
178+
$value
179179
);
180180
$value = preg_replace (
181181
"/return\s*\(\s*synth\s*\(\s*400,\s*\"X-Magento-Tags-Pattern or X-Pool header required\"\s*\)\s*\);/m",
182182
"return (synth(400, \"X-Magento-Tags-Pattern or X-Pool or JR-Purge header required\"));",
183-
$value,
183+
$value
184184
);
185185
$value = preg_replace (
186186
"/return\s*\(\s*synth\s*\(\s*200,\s*\"Purged\"\s*\)\s*\);/m",
@@ -190,7 +190,7 @@ public function modifyRecv ( $node ) {
190190
" }",
191191
" return (synth(200, \"Purged\"));",
192192
]),
193-
$value,
193+
$value
194194
);
195195
$raw = "backend " . $node ["identifier"] . " {" . $value . "}";
196196
$node ["value"] = $value;

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ restart-varnish: ## Restart varnish container (updated vcl file)
4343

4444
dev-create: ## Create development environment
4545
composer global config repositories.magento composer https://repo.magento.com/
46-
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.2 ./public_html
47-
cd public_html && ln -s ../default.vcl ./default.vcl
48-
cd public_html && ln -s ../default.custom.vcl ./default.custom.vcl
46+
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.4 ./public_html
47+
cd public_html && ln -s ../docker-only.vcl ./default.vcl
48+
cd public_html && ln -s ../docker-only.custom.vcl ./default.custom.vcl
4949
cd public_html && ln -s ../.magento.docker.yml ./.magento.docker.yml
5050
cd public_html && ln -s ../.magento.setup.params ./.magento.setup.params
5151
cd public_html && ln -s ../docker-compose.override.yml ./docker-compose.override.yml

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
"autoload": {
2020
"psr-4": { "JetRails\\Varnish\\": "" },
2121
"files": [ "registration.php" ]
22+
},
23+
"require": {
24+
"php": ">=7.2"
2225
}
2326
}

0 commit comments

Comments
 (0)