HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cloudlinux/alt-php54/root/usr/share/pear/RVSeagullMod/lib/SGL/Request/Cli.php
<?php

class SGL_Request_Cli extends SGL_Request
{
    public function init($type=null)
    {
        require_once 'Console/Getopt.php';
        $shortOptions = '';
        $longOptions = array('moduleName=', 'managerName=', 'action=');

        $console = new Console_Getopt();
        $arguments = $console->readPHPArgv();
        array_shift($arguments);

        // catch arbitrary arguments
        for ($i = 3; $i < count($arguments); $i++) {
            array_push($longOptions, substr($arguments[$i], 2, strpos($arguments[$i], "=") - 1));
        }
        $options = $console->getopt2($arguments, $shortOptions, $longOptions);

        if (!is_array($options) ) {
            die("CLI parameters invalid\n");
        }

        $this->aProps = array();

        /* Take all _valid_ parameters and add them into aProps. */
        while (list($parameter, $value) = each($options[0])) {
            $value[0] = str_replace('--', '', $value[0]);
            $this->aProps[$value[0]] = $value[1];
        }
        $this->type = SGL_REQUEST_CLI;
        return true;
    }
}
?>