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/extmag/dhlshipping2/Setup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/extmag/dhlshipping2/Setup/RecurringData.php
<?php
/**
 * Copyright © Extmag. All rights reserved.
 */

namespace Extmag\DhlShipping\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Exception;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem\Io\File;

class RecurringData implements InstallDataInterface
{
    /**
     * @var File
     */
    public $io;

    /**
     * @var DirectoryList
     */
    public $directoryList;

    /**
     * @var ModuleDataSetupInterface
     */
    public $moduleDataSetup;

    /**
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param File $io
     * @param DirectoryList $directoryList
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        File $io,
        DirectoryList $directoryList
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->io = $io;
        $this->directoryList = $directoryList;
    }

    /**
     * @inheritDoc
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $mediaPath = $this->directoryList->getPath('media');
        if (!$this->io->fileExists($mediaPath . '/extmag/dhl/label/pdf', false)) {
            $this->io->mkdir($mediaPath . '/extmag/dhl/label/pdf', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/label/png', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/label/jpg', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/label/zpl', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/label/epl', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/archive/pdf', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/archive/zpl', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/archive/epl', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/hvr', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/turn_in_copy', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/invoice', 0775);
            $this->io->mkdir($mediaPath . '/extmag/dhl/dg_paper', 0775);
        }

        if (!$this->io->fileExists($mediaPath . '/extmag/packaging_slip', false)) {
            $this->io->mkdir($mediaPath . '/extmag/packaging_slip', 0775);
        }

        if (!$this->io->fileExists($mediaPath . '/extmag/upload/dhl', false)) {
            $this->io->mkdir($mediaPath . '/extmag/upload/dhl', 0775);
        }
        if (!$this->io->fileExists($mediaPath . '/extmag/dhl/label/pdf', false)) {
            throw new Exception(__('Folder ' . $mediaPath . '/extmag/dhl/label/pdf cannot be created'));
        }
    }
}

Spamworldpro Mini