Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FileExists.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class FileExists implements \Magento\Framework\View\Asset\MergeStrategyInterface
14 {
18  protected $strategy;
19 
23  protected $filesystem;
24 
29  public function __construct(
31  \Magento\Framework\Filesystem $filesystem
32  ) {
33  $this->strategy = $strategy;
34  $this->filesystem = $filesystem;
35  }
36 
40  public function merge(array $assetsToMerge, \Magento\Framework\View\Asset\LocalInterface $resultAsset)
41  {
42  $dir = $this->filesystem->getDirectoryRead(DirectoryList::STATIC_VIEW);
43  if (!$dir->isExist($resultAsset->getPath())) {
44  $this->strategy->merge($assetsToMerge, $resultAsset);
45  }
46  }
47 }
__construct(\Magento\Framework\View\Asset\MergeStrategyInterface $strategy, \Magento\Framework\Filesystem $filesystem)
Definition: FileExists.php:29
merge(array $assetsToMerge, \Magento\Framework\View\Asset\LocalInterface $resultAsset)
Definition: FileExists.php:40