src/Nabu/Autoloader.php
protected function loadPackageStack($class, array $package_stack)
    {
        foreach ($package_stack as $package) {
            $package_length = strlen($package);

            $class_path = substr($class, $package_length);

            $this->updateLog("debug", "Found class path {$class_path} in {$class} given {$package}");

            $package_loaded = $this->loadPackage($package, $class_path);

            if ($package_loaded) {
                $this->updateLog("info", "Loaded {$class_path} using package {$package}");
                return true;
            }
        }

        $this->updateLog("alert", "No files found for {$class} in registered packages!");

        return false;
    }
protected function loadPackageStack($class, array $package_stack)
    {
        foreach ($package_stack as $package) {
            $package_length = strlen($package);

            $class_path = substr($class, $package_length);

            $this->updateLog("debug", "Found class path {$class_path} in {$class} given {$package}");

            $package_loaded = $this->loadPackage($package, $class_path);

            if ($package_loaded) {
                $this->updateLog("info", "Loaded {$class_path} using package {$package}");
                return true;
            }
        }

        $this->updateLog("alert", "No files found for {$class} in registered packages!");

        return false;
    }
protected function loadPackageStack ( $ class , array $ package_stack ) { foreach ( $ package_stack as $ package ) { $ package_length = strlen ( $ package ) ; $ class_path = substr ( $ class , $ package_length ) ; $ this -> updateLog ( "debug" , "Found class path {$class_path} in {$class} given {$package}" ) ; $ package_loaded = $ this -> loadPackage ( $ package , $ class_path ) ; if ( $ package_loaded ) { $ this -> updateLog ( "info" , "Loaded {$class_path} using package {$package}" ) ; return true ; } } $ this -> updateLog ( "alert" , "No files found for {$class} in registered packages!" ) ; return false ; }
Attempts to load a class from a stack of packages

@param string $class         The fully-qualified class name
@param array $package_stack  A stack of packages for loading

@return bool                 Returns true if the class was successfully loaded from the package stack
Returns false if the class could not be loaded from the package stack
Attempts to load a class from a stack of packages