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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/enlightn/enlightn/src/   drwxr-xr-x
Free 13.06 GB of 57.97 GB (22.52%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Enlightn\Enlightn;

use 
Enlightn\Enlightn\Analyzers\Trace;
use 
Illuminate\Filesystem\Filesystem;
use 
Illuminate\Support\Arr;
use 
Illuminate\Support\Str;
use 
Symfony\Component\Process\Process;

class 
PHPStan
{
    
/**
     * The PHPStan analysis result.
     *
     * @var array
     */
    
public $result;

    
/**
     * The filesystem instance.
     *
     * @var \Illuminate\Filesystem\Filesystem
     */
    
protected $files;

    
/**
     * The project root path.
     *
     * @var string|null
     */
    
protected $rootPath;

    
/**
     * The PHPStan configuration file path.
     *
     * @var string|null
     */
    
protected $configPath;

    
/**
     * Create a new PHPStan manager instance.
     *
     * @param  \Illuminate\Filesystem\Filesystem  $files
     * @param  string|null  $rootPath
     * @return void
     */
    
public function __construct(Filesystem $files$rootPath null)
    {
        
$this->files $files;
        
$this->rootPath $rootPath;
    }

    
/**
     * Parse the PHPStan analysis and get the results containing the search string.
     *
     * @param string|array $search
     * @return array
     */
    
public function parseAnalysis($search)
    {
        if (! isset(
$this->result['files'])) {
            return [];
        }

        return 
collect($this->result['files'])->map(function ($fileAnalysis$path) use ($search) {
            return 
collect($fileAnalysis['messages'])->filter(function ($message) use ($search) {
                return 
Str::contains($message['message'], $search);
            })->
map(function ($message) use ($path) {
                return new 
Trace($path$message['line'], $message['message']);
            })->
flatten()->toArray();
        })->
filter()->flatten()->toArray();
    }

    
/**
     * Parse the PHPStan analysis and get the results matching the pattern.
     *
     * @param  string|array  $pattern
     * @return array
     */
    
public function match($pattern)
    {
        if (! isset(
$this->result['files'])) {
            return [];
        }

        return 
collect($this->result['files'])->map(function ($fileAnalysis$path) use ($pattern) {
            return 
collect($fileAnalysis['messages'])->filter(function ($message) use ($pattern) {
                return 
Str::is($pattern$message['message']);
            })->
map(function ($message) use ($path) {
                return new 
Trace($path$message['line'], $message['message']);
            })->
flatten()->toArray();
        })->
filter()->flatten()->toArray();
    }

    
/**
     * Run the PHPStan analysis and get the output
     *
     * @param  string|array  $paths
     * @param  string|null  $configPath
     * @return $this
     */
    
public function start($paths$configPath null)
    {
        
$configPath $configPath ?? $this->configPath ?? (__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'phpstan.neon');

        
$options = ['analyse''--configuration='.$configPath'--error-format=json''--no-progress'];

        foreach (
Arr::wrap($paths) as $path) {
            
$options[] = $path;
        }

        
$this->result json_decode($this->runCommand($optionsfalse), true);

        return 
$this;
    }

    
/**
     * Run any PHPStan command and get the output
     *
     * @param  array  $options
     * @param  bool  $includeErrorOutput
     * @return string
     */
    
public function runCommand(array $options = [], $includeErrorOutput true)
    {
        
$phpStan $this->findPHPStan();

        
$command array_merge((array) $phpStan$options);

        
$process $this->getProcess($command);

        
$process->run();

        return 
$process->getOutput().($includeErrorOutput $process->getErrorOutput() : '');
    }

    
/**
     * Set the PHPStan configuration file path.
     *
     * @param string $configPath
     * @return $this
     */
    
public function setConfigPath(string $configPath)
    {
        
$this->configPath $configPath;

        return 
$this;
    }

    
/**
     * Get the PHPStan command for the environment.
     *
     * @return array
     */
    
protected function findPHPStan()
    {
        return [
$this->rootPath.'/vendor/bin/phpstan'];
    }

    
/**
     * Get a new Symfony process instance.
     *
     * @param  array  $command
     * @return \Symfony\Component\Process\Process
     */
    
protected function getProcess(array $command)
    {
        return (new 
Process($command$this->rootPath))->setTimeout(null);
    }

    
/**
     * Set the root path used by the class.
     *
     * @param  string  $path
     * @return $this
     */
    
public function setRootPath(string $path)
    {
        
$this->rootPath realpath($path);

        return 
$this;
    }
}

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