!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)

/usr/share/php/Symfony/Component/Console/Tester/   drwxr-xr-x
Free 28.55 GB of 117.98 GB (24.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     TesterTrait.php (5.88 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\Tester;

use 
PHPUnit\Framework\Assert;
use 
Symfony\Component\Console\Input\InputInterface;
use 
Symfony\Component\Console\Output\ConsoleOutput;
use 
Symfony\Component\Console\Output\OutputInterface;
use 
Symfony\Component\Console\Output\StreamOutput;
use 
Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful;

/**
 * @author Amrouche Hamza <hamza.simperfit@gmail.com>
 */
trait TesterTrait
{
    
/** @var StreamOutput */
    
private $output;
    private 
$inputs = [];
    private 
$captureStreamsIndependently false;
    
/** @var InputInterface */
    
private $input;
    
/** @var int */
    
private $statusCode;

    
/**
     * Gets the display returned by the last execution of the command or application.
     *
     * @throws \RuntimeException If it's called before the execute method
     *
     * @return string
     */
    
public function getDisplay(bool $normalize false)
    {
        if (
null === $this->output) {
            throw new 
\RuntimeException('Output not initialized, did you execute the command before requesting the display?');
        }

        
rewind($this->output->getStream());

        
$display stream_get_contents($this->output->getStream());

        if (
$normalize) {
            
$display str_replace(\PHP_EOL"\n"$display);
        }

        return 
$display;
    }

    
/**
     * Gets the output written to STDERR by the application.
     *
     * @param bool $normalize Whether to normalize end of lines to \n or not
     *
     * @return string
     */
    
public function getErrorOutput(bool $normalize false)
    {
        if (!
$this->captureStreamsIndependently) {
            throw new 
\LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
        }

        
rewind($this->output->getErrorOutput()->getStream());

        
$display stream_get_contents($this->output->getErrorOutput()->getStream());

        if (
$normalize) {
            
$display str_replace(\PHP_EOL"\n"$display);
        }

        return 
$display;
    }

    
/**
     * Gets the input instance used by the last execution of the command or application.
     *
     * @return InputInterface
     */
    
public function getInput()
    {
        return 
$this->input;
    }

    
/**
     * Gets the output instance used by the last execution of the command or application.
     *
     * @return OutputInterface
     */
    
public function getOutput()
    {
        return 
$this->output;
    }

    
/**
     * Gets the status code returned by the last execution of the command or application.
     *
     * @throws \RuntimeException If it's called before the execute method
     *
     * @return int
     */
    
public function getStatusCode()
    {
        if (
null === $this->statusCode) {
            throw new 
\RuntimeException('Status code not initialized, did you execute the command before requesting the status code?');
        }

        return 
$this->statusCode;
    }

    public function 
assertCommandIsSuccessful(string $message ''): void
    
{
        
Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message);
    }

    
/**
     * Sets the user inputs.
     *
     * @param array $inputs An array of strings representing each input
     *                      passed to the command input stream
     *
     * @return $this
     */
    
public function setInputs(array $inputs)
    {
        
$this->inputs $inputs;

        return 
$this;
    }

    
/**
     * Initializes the output property.
     *
     * Available options:
     *
     *  * decorated:                 Sets the output decorated flag
     *  * verbosity:                 Sets the output verbosity flag
     *  * capture_stderr_separately: Make output of stdOut and stdErr separately available
     */
    
private function initOutput(array $options)
    {
        
$this->captureStreamsIndependently \array_key_exists('capture_stderr_separately'$options) && $options['capture_stderr_separately'];
        if (!
$this->captureStreamsIndependently) {
            
$this->output = new StreamOutput(fopen('php://memory''w'false));
            if (isset(
$options['decorated'])) {
                
$this->output->setDecorated($options['decorated']);
            }
            if (isset(
$options['verbosity'])) {
                
$this->output->setVerbosity($options['verbosity']);
            }
        } else {
            
$this->output = new ConsoleOutput(
                
$options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL,
                
$options['decorated'] ?? null
            
);

            
$errorOutput = new StreamOutput(fopen('php://memory''w'false));
            
$errorOutput->setFormatter($this->output->getFormatter());
            
$errorOutput->setVerbosity($this->output->getVerbosity());
            
$errorOutput->setDecorated($this->output->isDecorated());

            
$reflectedOutput = new \ReflectionObject($this->output);
            
$strErrProperty $reflectedOutput->getProperty('stderr');
            
$strErrProperty->setAccessible(true);
            
$strErrProperty->setValue($this->output$errorOutput);

            
$reflectedParent $reflectedOutput->getParentClass();
            
$streamProperty $reflectedParent->getProperty('stream');
            
$streamProperty->setAccessible(true);
            
$streamProperty->setValue($this->outputfopen('php://memory''w'false));
        }
    }

    
/**
     * @return resource
     */
    
private static function createStream(array $inputs)
    {
        
$stream fopen('php://memory''r+'false);

        foreach (
$inputs as $input) {
            
fwrite($stream$input.\PHP_EOL);
        }

        
rewind($stream);

        return 
$stream;
    }
}

:: 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.0036 ]--