SPL autoload function, loads a class file based on the class name.

@param string
777368
public function loadClass($className)
	{
		if (class_exists($className, false) || interface_exists($className, false))
		{
			return false;
		}

		if($classFile = $this->classFile($className))
		{
			require $classFile;
			return true;
		}

		return false;
	}
724489
public static function onAutoLoad($class)
    {
        if (isset(self::$customMappings[$class])) {
            require_once(self::$customMappings[$class]);

            return true;
        }

        if (self::$_namespaces !== null) {
            foreach (self::$_namespaces as $data) {
                $ns = $data[0];

                $nsl = $data[2];


                if (substr($class, 0, $nsl) !== $ns) {
                    continue;
                }

                $dir = $data[1];
                $ext = $data[3];

                $file = $dir . str_replace('\\', '/', substr($class, $nsl)) . $ext;

                if (is_file($file)) {
                    require_once($file);

                    return true;
                }
            }
        }

        return false;
    }
994445
public static function autoload($className) {
        if (array_key_exists($className, self::$classes)) {
            $fileName = realpath(dirname(__FILE__)) . '/' . self::$classes[$className];
            if (file_exists($fileName)) {
                include $fileName;
            }
        }
    }
751752
protected function __autoload($className)
	{
		// Single modules autoload

		foreach ($this->config('defaultAutoloads') as $key => $dir)
		{
			$fileName = $dir . DIRECTORY_SEPARATOR . $className . '.php';
			$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $fileName);

			if (file_exists($fileName) && !class_exists($className))
			{
				$this->loadFiles[$className] = $fileName;

				require $fileName;
			}
		}

		// Multi-Modules autoload

		$modules = array_merge([], $this->config('modules'));

		foreach ($modules as $key => $module)
		{
			$module = ($module == '') ? $module : $module . DIRECTORY_SEPARATOR;

			foreach ($this->config('mvcDirs') as $k => $mvc)
			{
                $phpFile  = explode("\\", $className);
                $phpFile  = $phpFile[count($phpFile) - 1];
				$fileName = $this->path . str_replace('\\', DIRECTORY_SEPARATOR, strtolower(str_replace($phpFile, '', $className))). $phpFile . '.php';

				if (file_exists($fileName) && !class_exists($className))
				{
					$this->loadFiles[$className] = $fileName;

					require $fileName;
				}
			}
		}

		// User custom autoloads

		foreach ($this->config('autoloads') as $key => $dir)
		{
			$fileName = realpath($dir) . DIRECTORY_SEPARATOR . $className . '.php';
			$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $fileName);

			if (file_exists($fileName) && !class_exists($className))
			{
				$this->loadFiles[$className] = $fileName;

				require $fileName;
			}
		}
	}
602757
public function loadClass($class)
    {
        if (array_key_exists($class, $aliases = $this->classAliasList->getRegisteredAliases())) {
            // we have an alias for it, but we don't have it yet loaded
            // (because after all, we're in the auto loader.)
            $fullClass = $aliases[$class];
            if (!class_exists($fullClass, false)) {
                spl_autoload_call($fullClass);
            }
            // finally, we set up a class alias for this list. We do this now because
            // we don't know earlier what namespace it'll be in
            class_alias($fullClass, $class);
        }
    }
228231
protected function internal_autoloader( $classname ) {
		// Convert the namespace to a sub-directory path
		$classname = $this->classname_to_path( $classname );

		// Define our file path
		$file_path = PAULUS_BASE_DIR . $classname . '.php';

		// If the file is readable
		if ( is_readable($file_path) ) {
			// Require... just once. ;)
			require_once( $file_path );
		}
	}
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);
			}
			
		}
		
	}
384137
private function autoload($class)
    {
        $class = str_replace('main\\', '', $class);
        //var_dump($class );
        $file = realpath(dirname($this->appPath . '/../../')) . '/' . $class . '.php';
        $file = str_replace(['\\', '//'], ['/', '/'], $file);
        //var_dump($file );
        if (is_file($file)) {
            include_once $file;
            return;
        }
    }
1065446
public function loader($class)
    {
        if (isset($this->aliases[$class])) {
            class_alias($this->aliases[$class], $class);
            return;
        }

        if ($this->namespacing) {
            if ($alias = $this->getNamespaceAlias($class)) {
                class_alias($this->aliases[$alias], $class);
            }
        }
    }
623601
public static function autoload($class)
    {
        $self = self::getInstance();

        foreach ($self->getClassAutoloaders($class) as $autoloader) {
            if ($autoloader instanceof Zend_Loader_Autoloader_Interface) {
                if ($autoloader->autoload($class)) {
                    return true;
                }
            } elseif (is_array($autoloader)) {
                if (call_user_func($autoloader, $class)) {
                    return true;
                }
            } elseif (is_string($autoloader) || is_callable($autoloader)) {
                if ($autoloader($class)) {
                    return true;
                }
            }
        }

        return false;
    }
1316837
public static function load($class)
    {
        // Get just class name without ns
        $className = self::getOnlyClass($class);
        // Get just ns without class name
        $nameSpace = self::getOnlyNameSpace($class);

        // If this is not core class
        if ($nameSpace != __NAMESPACE__) {
            // Convert namespace to base directory add class
            $path = __SAMSON_VENDOR_PATH . str_replace('\\', DIRECTORY_SEPARATOR, $nameSpace) . DIRECTORY_SEPARATOR . $className . '.php';

            // Load class by file name
            if (file_exists($path)) {
                //elapsed('Autoloading class '.$class.' at '.$path);
                require_once($path);
                // old school compatibility will be removed when old modules will be updated
            } else if (self::oldModule($className, $nameSpace, $path)) {
                //elapsed('Autoloading(old style) class '.$class.' at '.$path);
                require_once($path);
                // Handle old module loading
            } else { // Signal error
                return e('Class name ## not found', E_SAMSON_CORE_ERROR, $class);
            }

        } else { // Load core classes separately using this class location
            require_once(__DIR__ . '/' . $className . '.php');
        }

        return true;
    }
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 );
			}
		}

	}
1010655
public static function class_loader($name) {
        if (strncmp(__NAMESPACE__ . '\\', $name, self::$len) !== 0) {
            return false;
        }
        $name = substr($name, self::$len);
        $file_path = __DIR__ . '/' . str_replace('\\', '/', $name) . '.php';
        if (file_exists($file_path) && is_readable($file_path)) {
            include($file_path);
            return true;
        }
        return false;
    }
793392
public function loadClass(string $class): ?bool
    {
        if ($file = $this->findFile($class)) {
            _includeClassFile($file);
            return true;
        }

        return null;
    }
386345
public static function autoload($class)
    {
        if ($class === 'Cpdf') {
            require_once __DIR__ . "/../lib/Cpdf.php";
            return;
        }

        $prefixLength = strlen(self::PREFIX);
        if (0 === strncmp(self::PREFIX, $class, $prefixLength)) {
            $file = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, $prefixLength));
            $file = realpath(__DIR__ . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
            if (file_exists($file)) {
                require_once $file;
            }
        }
    }
620943
static function autoload($class)
	{
		$root = explode('\\', trim($class, '\\'), 2);
		if (count($root) > 1 and isset(self::$namespaces[$root[0]]))
		{
            include self::$namespaces[$root[0]].'/'.str_replace('\\', '/', $root[1]).'.php';
		}
	}
1368234
public static function load($class)
    {
        /* Protects us from possible remote code inclusion due to:
           https://bugs.php.net/bug.php?id=55475
           We should already be safe without this check due to the
           way this autoloader works, but this helps other autoloaders
           that use other mechanisms and may be vulnerable. */
        if (strpos($class, ":") !== false) {
            // Safer than returning false as it prevents
            // other autoloaders from ever executing...
            throw new \Exception('Possible remote code injection detected');
        }

        // need to check if there's a current map file specified ALSO.
        // this could be the first time writing it.
        $mapped = self::isMapped($class);
        if ($mapped) {
            require_once self::$map[$class];
            if (!self::loadSuccessful($class)) {
                // record this failure & keep going, we may still find it
                self::$unmapped[] = $class;
            } else {
                return true;
            }
        }

        $file = str_replace(
            array('_', '\\'),
            DIRECTORY_SEPARATOR,
            $class
        ) . '.php';
        foreach (self::$paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . $file)) {
                require_once $path . DIRECTORY_SEPARATOR . $file;
                if (!self::loadSuccessful($class)) {
                    throw new \Exception(
                        'Class ' . $class . ' was not present in ' .
                        $path . DIRECTORY_SEPARATOR . $file .
                        '") [Autoload]'
                    );
                }

                if (in_array($class, self::$unmapped)) {
                    self::updateMap(
                        $class,
                        $path . DIRECTORY_SEPARATOR . $file
                    );
                }
                return true;
            }
        }

        $e = new \Exception(
            'Class ' . $class . ' could not be loaded from ' .
            $file . ', file does not exist (registered paths="' .
            implode(PATH_SEPARATOR, self::$paths) .
            '") [Autoload]'
        );
        $trace = $e->getTrace();
        if (isset($trace[2]) && isset($trace[2]['function']) &&
            in_array(
                $trace[2]['function'],
                array('class_exists', 'interface_exists')
            )) {
            return false;
        }
        if (isset($trace[1]) && isset($trace[1]['function']) &&
            in_array(
                $trace[1]['function'],
                array('class_exists', 'interface_exists')
            )) {
            return false;
        }

        // If there are other autoload functions registered,
        // let's try to play nicely with them...
        // ...otherwise, we just throw an exception.
        if (count(spl_autoload_functions()) == 1) {
            throw $e;
        }
        return false;
    }