52 \
Magento\MediaStorage\Helper\File\Storage\Database $fileStorageDatabase,
53 \
Magento\MediaStorage\Model\File\Storage\DatabaseFactory $storageDatabaseFactory,
58 $this->_rootDir =
$filesystem->getDirectoryWrite($this->rootDirBasePath);
59 $this->_fileStorageDatabase = $fileStorageDatabase;
60 $this->_storageDatabaseFactory = $storageDatabaseFactory;
61 $this->_fileFactory = $fileFactory;
79 __(
'Path "%1" is not part of allowed directory "%2"',
$relativePath, $this->rootDirBasePath)
83 $this->_fileFactory->create(
85 [
'value' => $this->_rootDir->getRelativePath(
$relativePath),
'type' =>
'filename'],
100 $pathWithFixedSeparator = str_replace(
'\\',
'/', $this->_rootDir->getDriver()->getRealPath($filePath));
101 return (strpos($pathWithFixedSeparator,
$relativePath) !==
false 115 if (!$this->_fileStorageDatabase->checkDbUsage()) {
118 $file = $this->_storageDatabaseFactory->create()->loadByFilename(
$relativePath);
119 if (!$file->getId()) {
124 $stream->write($filePath, $file->getContent());
_isCanProcessed($relativePath)
foreach( $_productCollection as $_product)() ?>" class $info
__construct(\Magento\Framework\Filesystem $filesystem, \Magento\MediaStorage\Helper\File\Storage\Database $fileStorageDatabase, \Magento\MediaStorage\Model\File\Storage\DatabaseFactory $storageDatabaseFactory, \Magento\Framework\App\Response\Http\FileFactory $fileFactory, $rootDirBasePath=DirectoryList::MEDIA)
_processDatabaseFile($filePath, $relativePath)