Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/vendor/consolidation/robo/src/ClassDiscovery/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/vendor/consolidation/robo/src/ClassDiscovery/RelativeNamespaceDiscovery.php

<?php

namespace Robo\ClassDiscovery;

use Symfony\Component\Finder\Finder;
use Composer\Autoload\ClassLoader;

/**
 * Class RelativeNamespaceDiscovery
 *
 * @package Robo\Plugin\ClassDiscovery
 */
class RelativeNamespaceDiscovery extends AbstractClassDiscovery
{
    /**
     * @var \Composer\Autoload\ClassLoader
     */
    protected $classLoader;

    /**
     * @var string
     */
    protected $relativeNamespace = '';

    /**
     * RelativeNamespaceDiscovery constructor.
     *
     * @param \Composer\Autoload\ClassLoader $classLoader
     */
    public function __construct(ClassLoader $classLoader)
    {
        $this->classLoader = $classLoader;
    }

    /**
     * @param string $relativeNamespace
     *
     * @return $this
     */
    public function setRelativeNamespace($relativeNamespace)
    {
        $this->relativeNamespace = $relativeNamespace;

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function getClasses()
    {
        $classes = [];
        $relativePath = $this->convertNamespaceToPath($this->relativeNamespace);

        foreach ($this->classLoader->getPrefixesPsr4() as $baseNamespace => $directories) {
            $directories = array_filter(array_map(function ($directory) use ($relativePath) {
                return $directory . $relativePath;
            }, $directories), 'is_dir');

            if ($directories) {
                foreach ($this->search($directories, $this->searchPattern) as $file) {
                    $relativePathName = $file->getRelativePathname();
                    $classes[] = $baseNamespace . $this->convertPathToNamespace($relativePath . '/' . $relativePathName);
                }
            }
        }

        return $classes;
    }

    /**
     * {@inheritdoc}
     */
    public function getFile($class)
    {
        return $this->classLoader->findFile($class);
    }

    /**
     * @param string|array $directories
     * @param string $pattern
     *
     * @return \Symfony\Component\Finder\Finder
     */
    protected function search($directories, $pattern)
    {
        $finder = new Finder();
        $finder->files()
          ->name($pattern)
          ->in($directories);

        return $finder;
    }

    /**
     * @param string $path
     *
     * @return string
     */
    protected function convertPathToNamespace($path)
    {
        return str_replace(['/', '.php'], ['\\', ''], trim($path, '/'));
    }

    /**
     * @param string $namespace
     *
     * @return string
     */
    public function convertNamespaceToPath($namespace)
    {
        return '/' . str_replace("\\", '/', trim($namespace, '\\'));
    }
}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net