![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/app/code/Soon/AdvancedCache/Model/Engine/Type/ |
<?php namespace Soon\AdvancedCache\Model\Engine\Type; use Magento\Customer\Model\Context as CustomerContext; use Magento\Store\Model\ScopeInterface; class Standard extends EngineTypeAbstract { /** * {@inheritdoc} */ public function addCacheTags() { $tags = []; if ($blockIdentities = $this->getBlock()->getIdentities()) { $tags = array_merge($tags, $blockIdentities); } $this->tags = $tags; } /** * {@inheritdoc} */ public function setLifetime() { if (!$sacData = $this->getBlock()->getData('soon_advancedcache')) { $blockName = $this->getBlock()->getNameInLayout(); $msg = 'Block with name "' . $blockName . '" supposes to be cacheable, but empty SAC data provided.'; throw new \RuntimeException($msg); } $this->lifetime = isset($sacData['lifetime']) ? $sacData['lifetime'] : $this->config->getValue( 'soon_advancedcache/general/default_lifetime', ScopeInterface::SCOPE_STORE ); } /** * {@inheritdoc} */ public function buildCacheKey() { $request = $this->getRequest(); $cacheKey = [ $this->implodeArray('|', $request->getParams()), $request->getFullActionName(), $this->getBlock()->getNameInLayout(), $this->getStoreId(), $this->getDesign()->getDesignTheme()->getId(), $this->getHttpContext()->getValue(CustomerContext::CONTEXT_GROUP) ]; // phpcs:ignore Magento2.Security.InsecureFunction $this->key = md5(implode('_', $cacheKey)); } }