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/dev/tests/integration/testsuite/Magento/Deploy/_files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/dev/tests/integration/testsuite/Magento/Deploy/_files/theme.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
use Magento\Framework\Component\ComponentRegistrar;

$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();

/* @var \Magento\Framework\Filesystem $filesystem */
$filesystem = $objectManager->get(\Magento\Framework\Filesystem::class);
$appDir = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::APP);

if (!function_exists('rcopy')) {
    /**
     * Recursively copy files from one directory to another
     *
     * @param string $src - Source of files being moved
     * @param string $destination - Destination of files being moved
     * @return bool
     */
    function rcopy($src, $destination)
    {
        // If source is not a directory stop processing
        if (!is_dir($src)) {
            return false;
        }

        // If the destination directory does not exist create it
        // If the destination directory could not be created stop processing
        if (!is_dir($destination)) {
            if (!mkdir($destination)) {
                return false;
            }
        }
        // Open the source directory to read in files
        $iterator = new DirectoryIterator($src);
        foreach ($iterator as $file) {
            if ($file->isFile()) {
                copy($file->getRealPath(), $destination . '/' . $file->getFilename());
            } elseif (!$file->isDot() && $file->isDir()) {
                rcopy($file->getRealPath(), $destination . '/' . $file);
            }
        }
    }
}

/** @var ComponentRegistrar $registrar */
$registrar = $objectManager->get(ComponentRegistrar::class);

if (!$registrar->getPath(ComponentRegistrar::THEME, 'frontend/Magento/zoom1')) {
    ComponentRegistrar::register(
        ComponentRegistrar::THEME,
        'frontend/Magento/zoom1',
        __DIR__ . '/zoom1'
    );
}

if (!$registrar->getPath(ComponentRegistrar::THEME, 'frontend/Magento/zoom2')) {
    ComponentRegistrar::register(
        ComponentRegistrar::THEME,
        'frontend/Magento/zoom2',
        __DIR__ . '/zoom2'
    );
}

if (!$registrar->getPath(ComponentRegistrar::THEME, 'frontend/Magento/zoom3')) {
    ComponentRegistrar::register(
        ComponentRegistrar::THEME,
        'frontend/Magento/zoom3',
        __DIR__ . '/zoom3'
    );
}

if (!$registrar->getPath(ComponentRegistrar::THEME, 'frontend/Vendor/parent')) {
    ComponentRegistrar::register(
        ComponentRegistrar::THEME,
        'frontend/Vendor/parent',
        __DIR__ . '/Vendor/parent'
    );
}

if (!$registrar->getPath(ComponentRegistrar::THEME, 'frontend/Vendor/child')) {
    ComponentRegistrar::register(
        ComponentRegistrar::THEME,
        'frontend/Vendor/child',
        __DIR__ . '/Vendor/child'
    );
}

/** @var \Magento\Theme\Model\Theme\Registration $themeRegistration */
$themeRegistration = $objectManager->get(\Magento\Theme\Model\Theme\Registration::class);
$themeRegistration->register();

Spamworldpro Mini