Spamworldpro Mini Shell
Spamworldpro


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/vendor/magento/module-import-export/Model/Import/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/module-import-export/Model/Import/ImageDirectoryBaseProvider.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

declare(strict_types=1);

namespace Magento\ImportExport\Model\Import;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Filesystem\Directory\ReadInterface;
use Magento\Framework\Filesystem;
use Magento\Framework\App\Filesystem\DirectoryList;

/**
 * Provides base directory to use for images when user imports entities.
 */
class ImageDirectoryBaseProvider
{
    /**
     * @var ScopeConfigInterface
     */
    private $config;

    /**
     * @var Filesystem
     */
    private $filesystem;

    /**
     * @param ScopeConfigInterface $config
     * @param Filesystem $filesystem
     */
    public function __construct(ScopeConfigInterface $config, Filesystem $filesystem)
    {
        $this->config = $config;
        $this->filesystem = $filesystem;
    }

    /**
     * Directory that users are allowed to place images for importing.
     *
     * @return ReadInterface
     */
    public function getDirectory(): ReadInterface
    {
        $path = $this->getDirectoryRelativePath();

        return $this->filesystem->getDirectoryReadByPath(
            $this->filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath($path)
        );
    }

    /**
     * The directory's path relative to Magento root.
     *
     * @return string
     */
    public function getDirectoryRelativePath(): string
    {
        return $this->config->getValue('general/file/import_images_base_dir');
    }
}

Spamworldpro Mini