Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DepersonalizeChecker.php
Go to the documentation of this file.
1 <?php
7 
12 {
18  private $request;
19 
25  private $moduleManager;
26 
32  private $cacheConfig;
33 
39  public function __construct(
40  \Magento\Framework\App\RequestInterface $request,
41  \Magento\Framework\Module\Manager $moduleManager,
42  Config $cacheConfig
43  ) {
44  $this->request = $request;
45  $this->moduleManager = $moduleManager;
46  $this->cacheConfig = $cacheConfig;
47  }
48 
56  public function checkIfDepersonalize(\Magento\Framework\View\LayoutInterface $subject)
57  {
58  return ($this->moduleManager->isEnabled('Magento_PageCache')
59  && $this->cacheConfig->isEnabled()
60  && !$this->request->isAjax()
61  && ($this->request->isGet() || $this->request->isHead())
62  && $subject->isCacheable());
63  }
64 }
checkIfDepersonalize(\Magento\Framework\View\LayoutInterface $subject)
__construct(\Magento\Framework\App\RequestInterface $request, \Magento\Framework\Module\Manager $moduleManager, Config $cacheConfig)
$moduleManager
Definition: products.php:75