![]() 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/cartforge.co/vendor/magento/module-catalog/Model/View/Asset/Image/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\View\Asset\Image; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\View\Asset\ContextInterface; /** * Constructor modification point for Magento\Catalog\Model\View\Asset\Image. * * All context classes were introduced to allow for backwards compatible constructor modifications * of classes that were supposed to be extended by extension developers. * * Do not call methods of this class directly. * * As Magento moves from inheritance-based APIs all such classes will be deprecated together with * the classes they were introduced for. */ class Context implements ContextInterface { /** * @var \Magento\Framework\Filesystem\Directory\WriteInterface */ private $mediaDirectory; /** * @var \Magento\Catalog\Model\Product\Media\ConfigInterface */ private $mediaConfig; /** * @var \Magento\Framework\Filesystem */ private $filesystem; /** * @param \Magento\Catalog\Model\Product\Media\ConfigInterface $mediaConfig * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( \Magento\Catalog\Model\Product\Media\ConfigInterface $mediaConfig, \Magento\Framework\Filesystem $filesystem ) { $this->mediaConfig = $mediaConfig; $this->filesystem = $filesystem; $this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->mediaDirectory->create($this->mediaConfig->getBaseMediaPath()); } /** * {@inheritdoc} */ public function getPath() { return $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getBaseMediaPath()); } /** * {@inheritdoc} */ public function getBaseUrl() { return $this->mediaConfig->getBaseMediaUrl(); } }