!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/smm.picotech.app/public_html/vendor/symfony/error-handler/ErrorEnhancer/   drwxr-xr-x
Free 28.58 GB of 117.98 GB (24.23%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ClassNotFoundErrorEnhancer.php (6.36 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\ErrorHandler\ErrorEnhancer;

use 
Composer\Autoload\ClassLoader;
use 
Symfony\Component\ErrorHandler\DebugClassLoader;
use 
Symfony\Component\ErrorHandler\Error\ClassNotFoundError;
use 
Symfony\Component\ErrorHandler\Error\FatalError;

/**
 * @author Fabien Potencier <fabien@symfony.com>
 */
class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface
{
    
/**
     * {@inheritdoc}
     */
    
public function enhance(\Throwable $error): ?\Throwable
    
{
        
// Some specific versions of PHP produce a fatal error when extending a not found class.
        
$message = !$error instanceof FatalError $error->getMessage() : $error->getError()['message'];
        if (!
preg_match('/^(Class|Interface|Trait) [\'"]([^\'"]+)[\'"] not found$/'$message$matches)) {
            return 
null;
        }
        
$typeName strtolower($matches[1]);
        
$fullyQualifiedClassName $matches[2];

        if (
false !== $namespaceSeparatorIndex strrpos($fullyQualifiedClassName'\\')) {
            
$className substr($fullyQualifiedClassName$namespaceSeparatorIndex 1);
            
$namespacePrefix substr($fullyQualifiedClassName0$namespaceSeparatorIndex);
            
$message sprintf('Attempted to load %s "%s" from namespace "%s".'$typeName$className$namespacePrefix);
            
$tail ' for another namespace?';
        } else {
            
$className $fullyQualifiedClassName;
            
$message sprintf('Attempted to load %s "%s" from the global namespace.'$typeName$className);
            
$tail '?';
        }

        if (
$candidates $this->getClassCandidates($className)) {
            
$tail array_pop($candidates).'"?';
            if (
$candidates) {
                
$tail ' for e.g. "'.implode('", "'$candidates).'" or "'.$tail;
            } else {
                
$tail ' for "'.$tail;
            }
        }
        
$message .= "\nDid you forget a \"use\" statement".$tail;

        return new 
ClassNotFoundError($message$error);
    }

    
/**
     * Tries to guess the full namespace for a given class name.
     *
     * By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
     * autoloader (that should cover all common cases).
     *
     * @param string $class A class name (without its namespace)
     *
     * Returns an array of possible fully qualified class names
     */
    
private function getClassCandidates(string $class): array
    {
        if (!
\is_array($functions spl_autoload_functions())) {
            return [];
        }

        
// find Symfony and Composer autoloaders
        
$classes = [];

        foreach (
$functions as $function) {
            if (!
\is_array($function)) {
                continue;
            }
            
// get class loaders wrapped by DebugClassLoader
            
if ($function[0] instanceof DebugClassLoader) {
                
$function $function[0]->getClassLoader();

                if (!
\is_array($function)) {
                    continue;
                }
            }

            if (
$function[0] instanceof ClassLoader) {
                foreach (
$function[0]->getPrefixes() as $prefix => $paths) {
                    foreach (
$paths as $path) {
                        
$classes[] = $this->findClassInPath($path$class$prefix);
                    }
                }

                foreach (
$function[0]->getPrefixesPsr4() as $prefix => $paths) {
                    foreach (
$paths as $path) {
                        
$classes[] = $this->findClassInPath($path$class$prefix);
                    }
                }
            }
        }

        return 
array_unique(array_merge([], ...$classes));
    }

    private function 
findClassInPath(string $pathstring $classstring $prefix): array
    {
        if (!
$path realpath($path.'/'.strtr($prefix'\\_''//')) ?: realpath($path.'/'.\dirname(strtr($prefix'\\_''//'))) ?: realpath($path)) {
            return [];
        }

        
$classes = [];
        
$filename $class.'.php';
        foreach (new 
\RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path\RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
            if (
$filename == $file->getFileName() && $class $this->convertFileToClass($path$file->getPathName(), $prefix)) {
                
$classes[] = $class;
            }
        }

        return 
$classes;
    }

    private function 
convertFileToClass(string $pathstring $filestring $prefix): ?string
    
{
        
$candidates = [
            
// namespaced class
            
$namespacedClass str_replace([$path.\DIRECTORY_SEPARATOR'.php''/'], ['''''\\'], $file),
            
// namespaced class (with target dir)
            
$prefix.$namespacedClass,
            
// namespaced class (with target dir and separator)
            
$prefix.'\\'.$namespacedClass,
            
// PEAR class
            
str_replace('\\''_'$namespacedClass),
            
// PEAR class (with target dir)
            
str_replace('\\''_'$prefix.$namespacedClass),
            
// PEAR class (with target dir and separator)
            
str_replace('\\''_'$prefix.'\\'.$namespacedClass),
        ];

        if (
$prefix) {
            
$candidates array_filter($candidates, function ($candidate) use ($prefix) { return === strpos($candidate$prefix); });
        }

        
// We cannot use the autoloader here as most of them use require; but if the class
        // is not found, the new autoloader call will require the file again leading to a
        // "cannot redeclare class" error.
        
foreach ($candidates as $candidate) {
            if (
$this->classExists($candidate)) {
                return 
$candidate;
            }
        }

        try {
            require_once 
$file;
        } catch (
\Throwable $e) {
            return 
null;
        }

        foreach (
$candidates as $candidate) {
            if (
$this->classExists($candidate)) {
                return 
$candidate;
            }
        }

        return 
null;
    }

    private function 
classExists(string $class): bool
    
{
        return 
class_exists($classfalse) || interface_exists($classfalse) || trait_exists($classfalse);
    }
}

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