|
3 | 3 | * Copyright © Magento, Inc. All rights reserved.
|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
| 6 | + |
6 | 7 | namespace Magento\PageCache\Model;
|
7 | 8 |
|
8 | 9 | use Magento\Framework\App\ObjectManager;
|
|
12 | 13 | use Magento\PageCache\Model\Varnish\VclGeneratorFactory;
|
13 | 14 |
|
14 | 15 | /**
|
15 |
| - * Model is responsible for replacing default vcl template |
16 |
| - * file configuration with user-defined from configuration |
| 16 | + * Model is responsible for replacing default vcl template file configuration with user-defined from configuration |
17 | 17 | *
|
18 | 18 | * @api
|
19 | 19 | * @since 100.0.2
|
@@ -163,14 +163,16 @@ public function getVclFile($vclTemplatePath)
|
163 | 163 | $sslOffloadedHeader = $this->_scopeConfig->getValue(
|
164 | 164 | \Magento\Framework\HTTP\PhpEnvironment\Request::XML_PATH_OFFLOADER_HEADER
|
165 | 165 | );
|
166 |
| - $vclGenerator = $this->vclGeneratorFactory->create([ |
167 |
| - 'backendHost' => $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_BACKEND_HOST), |
168 |
| - 'backendPort' => $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_BACKEND_PORT), |
169 |
| - 'accessList' => $accessList ? explode(',', $accessList) : [], |
170 |
| - 'designExceptions' => $designExceptions ? $this->serializer->unserialize($designExceptions) : [], |
171 |
| - 'sslOffloadedHeader' => $sslOffloadedHeader, |
172 |
| - 'gracePeriod' => $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_GRACE_PERIOD) |
173 |
| - ]); |
| 166 | + $vclGenerator = $this->vclGeneratorFactory->create( |
| 167 | + [ |
| 168 | + 'backendHost' => $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_BACKEND_HOST), |
| 169 | + 'backendPort' => $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_BACKEND_PORT), |
| 170 | + 'accessList' => $accessList ? explode(',', $accessList) : [], |
| 171 | + 'designExceptions' => $designExceptions ? $this->serializer->unserialize($designExceptions) : [], |
| 172 | + 'sslOffloadedHeader' => $sslOffloadedHeader, |
| 173 | + 'gracePeriod' => $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_GRACE_PERIOD) |
| 174 | + ] |
| 175 | + ); |
174 | 176 | return $vclGenerator->generateVcl($version);
|
175 | 177 | }
|
176 | 178 |
|
@@ -200,13 +202,12 @@ protected function _getReplacements()
|
200 | 202 | }
|
201 | 203 |
|
202 | 204 | /**
|
203 |
| - * Get IPs access list that can purge Varnish configuration for config file generation |
204 |
| - * and transform it to appropriate view |
| 205 | + * Get IPs access list allowed purge Varnish config for config file generation and transform it to appropriate view |
205 | 206 | *
|
206 |
| - * acl purge{ |
| 207 | + * Example acl_purge{ |
207 | 208 | * "127.0.0.1";
|
208 | 209 | * "127.0.0.2";
|
209 |
| - * |
| 210 | + * } |
210 | 211 | * @return mixed|null|string
|
211 | 212 | * @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
|
212 | 213 | */
|
|
0 commit comments