Register an autoloader for the virtual filesystem

@param string The namespace to register
@param string The root of the autoloader
@param bool If true, use a psr-4 autoloader, otherwise a psr-0.
549675
public function addAutoloader($namespace, $path=null, $psr4=false)
    {
        $loader = new VirtFsLoader($this);
        $loader->register($namespace, $path, $psr4);
        $this->pushLoader($loader);
    }
1161947
static public function autoload($classname)
    {
        if (strpos($classname, __NAMESPACE__) === 0) {
            $classname = substr($classname, strlen(__NAMESPACE__) + 1);
            if (file_exists(__DIR__ . '/' . str_replace('\\', '/', $classname) . '.php')) {
                require_once __DIR__ . '/' . str_replace('\\', '/', $classname) . '.php';
            }
        }
    }
723823
public function autoload($className)
    {
        if ($this->namespace == null || $this->namespace.'\\' === substr($className, 0, strlen($this->namespace.'\\'))) {
            $fileName = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
            $namespace = '';
            if (false !== ($lastNsPos = strripos($className, '\\'))) {
                $namespace = substr($className, 0, $lastNsPos);
                $className = substr($className, $lastNsPos + 1);
                $fileName .= str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
            }
            $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
            require $fileName;
        }
    }
1348595
public static function registerNamespace($namespace, $prepend = false)
    {
        if (false === $prepend) {
            self::$namespaces[] = $namespace;
        } else {
            array_unshift(self::$namespaces, $namespace);
        }
    }
325895
protected function registerAutoloader($app)
    {
        // now configure a new autoloader spl configuration
        $autoloaderApp = new Doozr_Loader_Autoloader_Spl_Config();
        $autoloaderApp
            ->_namespace($app->namespace)
            ->namespaceSeparator('_')
            ->addExtension('php')
            ->path(substr($app->path, 0, -1))
            ->description('Autoloader for App classes with namespace: "'.$app->namespace.'"')
            ->priority(0);

        Doozr_Loader_Autoloader_Spl_Facade::attach([$autoloaderApp]);
    }
208860
public function registerAutoload($basePath, $prefix = '', $relative = true)
    {
        $path = $relative ? $this->basePath . '/' . $basePath : $basePath;

        Autoloader::getInstance()->registerAutoload($path, $prefix);
    }
277059
public static function autoload($class)
    {
        /**
         * Classes from unified namespace canot be loaded by this auto loader.
         * Do not try to load them in order to avoid strange errors in edge cases.
         */
        if (false !== strpos($class, 'OxidEsales\Eshop\\')) {
            return false;
        }
        $instance = static::getInstance();

        $class = strtolower(basename($class));

        if ($classPath = $instance->getFilePath($class)) {
            include $classPath;
        } else {
            $class = preg_replace('/_parent$/i', '', $class);

            if (!in_array($class, $instance->triedClasses)) {
                $instance->triedClasses[] = $class;
                $instance->createExtensionClassChain($class);
            }
        }
    }
577563
protected function addAnnotationsToRegistry()
    {
        // Creates annotation Reader.
        $reader = $this->app->make(AnnotationsReader::class);

        // Register files autoload.
        $reader->addFilesToRegistry(config('pine-annotations.autoload_files'));

        // Register namespaces autoload.
        $reader->addNamespacesToRegistry(config('pine-annotations.autoload_namespaces'));
    }
284474
public function register($prepend = false)
    {
        if (!$this->isLoaded) {
            spl_autoload_register(array($this, 'loadClass'), true, $prepend);
        }
        $this->isLoaded = true;
    }
429674
public function register($prepend = false)
    {

        if ($this->isRegistered())
            return $this;

        try {
            
            spl_autoload_register($this->handle, true, $prepend);
        } catch(\Exception $e) {

            throw new \RuntimeException(
                "Failed to register ".static::class." as a SPL autoloader (spl_autoload_register())", 0, $e
            );
        }

        return parent::register($prepend);
    }
1199158
public function registerProxyAutoloader()
    {
        $this->app->afterResolving(ManagerRegistry::class, function (ManagerRegistry $registry) {
            /** @var EntityManagerInterface $manager */
            foreach ($registry->getManagers() as $manager) {
                Autoloader::register(
                    $manager->getConfiguration()->getProxyDir(),
                    $manager->getConfiguration()->getProxyNamespace()
                );
            }
        });
    }
861211
private function setupServiceProvidersAutoloader($inputDirectory, array $services)
    {
        //creates the autoloader
        $loader = new Loader();

        //setup default path when is not defined
        foreach ($services as $className => $path) {
            if (!$path) {
                $services[$className] = $inputDirectory . sprintf('%s.php', $className);
            }
        }
        $loader->registerClasses($services, true);

        $loader->register();
    }
757354
public function register(): bool
    {
        return spl_autoload_register(function($objectName) {
            // ensure first namespace separator
            if ($objectName[0] != '\\') {
                $objectName = '\\'. $objectName;
            }

            // only Oppa stuff
            if (1 !== strpos($objectName, __namespace__)) {
                return;
            }

            $objectFile = strtr(sprintf('%s/%s.php', __dir__, $objectName), [
                '\\' => '/',
                __namespace__ => ''
            ]);

            if (!is_file($objectFile)) {
                throw new \RuntimeException("Object file '{$objectFile}' not found!");
            }

            require $objectFile;
        });
    }
603798
final public static function autoload($class)
    {
        if (version_compare(PHP_VERSION, '5.3', '>=') && __NAMESPACE__) {
            $class = str_replace(__NAMESPACE__, 'PHPTAL', $class);
            $class = strtr($class, '\\', '_');
        }

        if (substr($class, 0, 7) !== 'PHPTAL_') return;

        $path = dirname(__FILE__) . strtr("_".$class, "_", DIRECTORY_SEPARATOR) . '.php';

        require $path;
    }
566250
public static function registerLoader($loader, string ...$contentTypes): FluentDOM\Loaders {
    $loaders = self::getDefaultLoaders();
    if (count($contentTypes) > 0) {
      $lazyLoader = new \FluentDOM\Loader\Lazy();
      foreach ($contentTypes as $contentType) {
        $lazyLoader->add($contentType, $loader);
      }
      $loaders->add($lazyLoader);
    } elseif (is_callable($loader)) {
      self::registerLoader($loader());
    } else {
      $loaders->add($loader);
    }
    self::$_loader = NULL;
    return $loaders;
  }
1359299
public function autoload($class) {
        $classKey = strtolower($class);

        if (isset($this->classes[$classKey])) {
            list($_, $path) = $this->classes[$classKey];
            include_once $path;
        }
    }
276401
protected function registerAutoload($theme)
	{
        $composer = require(base_path('vendor/autoload.php'));
        
        $class = 'Themes\\'.$theme.'\\';
        $path  = $this->path('src/');

        if (! array_key_exists($class, $composer->getClassMap())) {
            $composer->addPsr4($class, $path);
        }
	}