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/Ecombricks/Inventory/Framework/Plugin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/Ecombricks/Inventory/Framework/Plugin/AbstractPlugin.php
<?php
/**
 * Copyright © eComBricks. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Ecombricks\Inventory\Framework\Plugin;

/**
 * Abstract plugin
 */
class AbstractPlugin extends \Ecombricks\Framework\Plugin\AbstractPlugin
{
    
    /**
     * Copy source code
     * 
     * @param object $from
     * @param object $to
     * @param boolean $copyIfEmpty
     */
    protected function copySourceCode($from, $to, $copyIfEmpty = true)
    {
        if (
            empty($from) || empty($to) || 
            !is_object($from) || !is_object($to) || 
            !method_exists($from, 'getSourceCode') || !method_exists($to, 'setSourceCode')
        ) {
            return $this;
        }
        $sourceCode = $from->getSourceCode();
        if (empty($sourceCode) && !$copyIfEmpty) {
            return $this;
        }
        $to->setSourceCode($sourceCode);
        return $this;
    }
    
    /**
     * Set source code
     * 
     * @param object $object
     * @param boolean $setIfEmpty
     * @return $this
     */
    protected function setSourceCode($object, $setIfEmpty = true)
    {
        $this->copySourceCode($this->getSubject(), $object, $setIfEmpty);
        return $this;
    }
    
}

Spamworldpro Mini