12 use Psr\Log\LoggerInterface;
27 private $versionStorage;
42 private $deploymentConfig;
54 $this->appState = $appState;
55 $this->versionStorage = $versionStorage;
66 if (!$this->cachedValue) {
67 $this->cachedValue = $this->
readValue($this->appState->getMode());
69 return $this->cachedValue;
80 $result = $this->versionStorage->load();
83 && !$this->deploymentConfig->getConfigData(
87 $this->getLogger()->critical(
'Can not load static content version.');
88 throw new \UnexpectedValueException(
89 "Unable to retrieve deployment version of static files from the file system." 92 $result = $this->generateVersion();
93 $this->versionStorage->save(
$result);
103 private function generateVersion()
114 private function getLogger()
116 if ($this->logger ==
null) {
118 ->get(LoggerInterface::class);
120 return $this->logger;
const CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION
__construct(\Magento\Framework\App\State $appState, \Magento\Framework\App\View\Deployment\Version\StorageInterface $versionStorage, DeploymentConfig $deploymentConfig=null)