Search and load a specific class. Used for auto-loader.

@param $class
@return bool
555657
public function load($class)
    {
        if ($class[0] == '\\') $class = substr($class, 1);
        $class = str_replace(array('\\', '_'), DIRECTORY_SEPARATOR, $class).'.php';

        foreach ($this->directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class))
            {
                require_once $path;
                return true;
            }
        }
        return false;
    }
371063
public static function load($class)
	{
		// deal with funny is_callable('static::classname') side-effect
		if (strpos($class, 'static::') === 0)
		{
			// is called from within the class, so it's already loaded
			return true;
		}

		$loaded = false;
		$class = ltrim($class, '\\');
		$namespaced = ($pos = strripos($class, '\\')) !== false;

		if (empty(static::$auto_initialize))
		{
			static::$auto_initialize = $class;
		}

		if (isset(static::$classes[strtolower($class)]))
		{
			static::init_class($class, str_replace('/', DS, static::$classes[strtolower($class)]));
			$loaded = true;
		}
		elseif ($full_class = static::find_core_class($class))
		{
			if ( ! class_exists($full_class, false) and ! interface_exists($full_class, false))
			{
				include static::prep_path(static::$classes[strtolower($full_class)]);
			}
			if ( ! class_exists($class, false))
			{
				class_alias($full_class, $class);
			}
			static::init_class($class);
			$loaded = true;
		}
		else
		{
			$full_ns = substr($class, 0, $pos);

			if ($full_ns)
			{
				foreach (static::$namespaces as $ns => $path)
				{
					$ns = ltrim($ns, '\\');
					if (stripos($full_ns, $ns) === 0)
					{
						$path .= static::class_to_path(
							substr($class, strlen($ns) + 1),
							array_key_exists($ns, static::$psr_namespaces)
						);
						if (is_file($path))
						{
							static::init_class($class, $path);
							$loaded = true;
							break;
						}
					}
				}
			}

			if ( ! $loaded)
			{
				$path = APPPATH.'classes/'.static::class_to_path($class);

				if (is_file($path))
				{
					static::init_class($class, $path);
					$loaded = true;
				}
			}
		}

		// Prevent failed load from keeping other classes from initializing
		if (static::$auto_initialize == $class)
		{
			static::$auto_initialize = null;
		}

		return $loaded;
	}
24596
protected function loadStackClass($class)
    {
        $stackQuery = \Staq\Util::getStackQuery($class);
        while ($stackQuery) {
            foreach (array_keys($this->extensions) as $extensionNamespace) {
                if ($realClass = $this->getRealClass($stackQuery, $extensionNamespace)) {
                    $this->createClassAlias($class, $realClass);
                    return TRUE;
                }
            }
            $stackQuery = \Staq\Util::popStackQuery($stackQuery);
        }

        $this->createClassEmpty($class);
    }
706263
protected static function _initialize($class) {
		$self = parent::_initialize($class);
		if (!$self->_inited) {
			$self->_inited = true;
			$self->_init();
		}
		return $self;
	}
1042485
public function getByModelClass($class)
    {
        $this->checkInitialization();

        if ( ! array_key_exists($class, $this->modelClassIndex)) {
            return false;
        }

        return $this->getByKey($this->modelClassIndex[$class]);
    }
1051948
public static function _autoLoad($class)
    {
        $path="";
        foreach (self::$m_classMap as $namespace=>$dir){
            if(!empty($namespace) && strpos($class, $namespace)===0){
                $namespace=rtrim($namespace,"\\");
                $class=substr($class, strlen($namespace));
                $path = rtrim($dir,"/").str_replace("\\", "/", $class) . ".php";
                break;
            }
        }
        if(file_exists($path)){
            require_once $path;
        }
    }
1357975
public static function autoload($class) {
        $name = $class;
        if(false !== strpos($name,'\\')){
          $name = strstr($class, '\\', true);
        }
        
        $filename = TOP_AUTOLOADER_PATH."/top/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/top/request/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/top/domain/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/aliyun/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/aliyun/request/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }

        $filename = TOP_AUTOLOADER_PATH."/aliyun/domain/".$name.".php";
        if(is_file($filename)) {
            include $filename;
            return;
        }         
    }
769042
public function autoload( $class ) {
		$parent               = explode( '\\', get_class( $this ) );
		$class_array          = explode( '\\', $class );
		$intersect            = array_intersect_assoc( $parent, $class_array );
		$intersect_depth      = count( $intersect );
		$autoload_match_depth = static::$autoload_ns_match_depth;
		// Confirm $class is in same namespace as this autoloader.
		if ( $intersect_depth >= $autoload_match_depth ) {
			$file = $this->get_file_name_from_class( $class );
			if ( 'classmap' === static::$autoload_type && is_array( $this->autoload_dir ) ) {
				foreach ( $this->autoload_dir as $dir ) {
					$this->load_file( $this->installed_dir . $dir . $file );
				}
			} else {
				$this->load_file( $this->installed_dir . $file );
			}
		}

	}
905960
private static function _autoload($class)
    {
        $realClass = $class;
        if (preg_match('/^JProxy_/i', $class)) {
            $class = preg_replace('/^JProxy_/i', '', $class);
        }
        foreach (self::$prefixes as $prefix => $lookup) {
            $chr = strlen($prefix) < strlen($class) ? $class[strlen($prefix)] : 0;

            if (strpos($class, $prefix) === 0 && ($chr === strtoupper($chr))) {
                $existsBefore = class_exists($realClass, false);
                if ($realClass === $class) {
                    self::loadByAlias($realClass);
                    self::load($realClass);
                }
                $return = true;
                if (!$existsBefore && !class_exists($class, false)) {
                    $return = self::_load(substr($class, strlen($prefix)), $lookup);
                }
                if ($realClass === $class && !$existsBefore && class_exists($realClass, false)) {
                    self::injectStaticDependencies($class);
                }

                return $return;
            }
        }

        return false;
    }
1032941
public static function load($class)
    {
        $file = static::normalizePath($class);

        if (file_exists($path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$file))
        {
            require $path;

            return true;
        }

        foreach (static::$directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$file))
            {
                require $path;

                return true;
            }
        }

        if (static::$aliases[$class])
        {
            class_alias(static::$aliases[$class], $class);

            return true;
        }
        
        return false;
    }
634070
public function findClass($class)
    {
        if (strrpos($class, '\\') !== false) {
            $file = Loaders\Psr4::getInstance()->findClass($class);
            if (!$file) {
                $file = Loaders\Psr0::getInstance()->findClass($class);
            }
        } else {
            $file = Loaders\Pear::getInstance()->findClass($class);
        }

        return $file;
    }
1288187
public function loadClass($class)
    {
        if (!$file = $this->findFile($class)) {
            return;
        }

        if (!$this->_patchers || !$this->patchable($class)) {
            includeFile($file);
            return true;
        }
        return $this->loadFile($file);
    }
465274
public static function _autoload ($class)
	{
		
		// Strip first slash
		
		$class		= ltrim ($class, '\\');
		$namespace	= NULL;
		$filename	= NULL;
		
		// If we're loading a sonic class
		
		if (stripos ($class, 'Sonic\\') === 0)
		{
			
			// Process namespace
			
			if ($nsPos = strripos ($class, '\\'))
			{
				$namespace	= substr ($class, 0, $nsPos);
				$class		= substr ($class, $nsPos + 1);
				$filename	= str_replace ('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
			}
			
			// Replace _ with directory seperator in class
			
			$filename	.= str_replace ('_', DIRECTORY_SEPARATOR, $class) . '.php';
			
			// Check for framework class first
			
			if (defined ('ABS_SONIC') && file_exists (ABS_SONIC . $filename))
			{
				require_once (ABS_SONIC . $filename);
			}
			
			// Else check class library
			
			else if (defined ('ABS_CLASSES') && file_exists (ABS_CLASSES . $filename))
			{
				require_once (ABS_CLASSES . $filename);
			}
			
		}
		
	}
636042
public static function autoload($class)
    {
        if (substr($class, -10) == "Controller") {
            self::loadController($class);
        } else if (substr($class, -5) == "Model") {
            self::loadModel($class);
        } else if (substr($class, -6) == "Helper") {
            self::loadHelper($class);
        }
    }
911555
public function load(string $class)
    {
        $alias = $this->loader;
        if (isset($alias[$class])) {
            class_alias($alias[$class], $class);
        }

        $class = $this->alias($class);
        if (!$this->container->has($class)) {
            return null;
        }

        $instance = $this->container[$class];
        if (is_object($instance)) {
            return $instance;
        }

        return null;
    }
606194
public static function load($class)
    {
        $class = static::normalizeClass($class);

        foreach (static::$directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class))
            {
                require_once $path;

                return true;
            }
        }
        return false;
    }
444756
public static function loadClass($class)
    {
        if (isset(self::$_classMap[$class]))
            return (bool)require sprintf('%s/%s', self::ROOT_DIR, self::$_classMap[$class]);
        return null;
    }