Try to load a class

@param string $class The class name to load

@return boolean If the loading was successful
771436
public function load($class)
    {
        $class = ltrim($class, '\\');

        if (strpos($class, $this->namespace) === 0) {
            $nsparts = explode('\\', $class);
            $class = array_pop($nsparts);
            $nsparts[ ] = '';
            $path = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
            $path .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';

            if (file_exists($path)) {
                require $path;

                return true;
            }
        }

        return false;
    }
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;
    }
180599
public function loadClass($class)
    {
        foreach (spl_autoload_functions() as $func) {
            if (is_array($func) && $func[0] === $this) {
                continue;
            }
            $this->classList->push($class);
            if (call_user_func($func, $class)) {
                break;
            }
        }

        $this->classList->next();

        return true;
    }
569309
public static function loadByPsr0($class)
    {
        $existsBefore = class_exists($class, false);
        $success = parent::loadByPsr0($class);
        if (!$existsBefore && class_exists($class, false)) {
            self::injectStaticDependencies($class);
        }

        return $success;
    }
116618
public function autoload($class)
    {
        if ($this->_collectClasses) {
            $this->_arrLoadedClasses[self::$_scope][] = $class;
        }

	    $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class)));

	    if ($this->_isIncludePathDefined) {
            $classFile =  COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class;
        }

        $classFile.= '.php';

        if (stream_resolve_include_path($classFile)) {
            return include $classFile;
        }

        $classFile = ltrim($this->classToFile($class) . '.php', '\\/');
	    if (stream_resolve_include_path($classFile)) {
		    return include $classFile;
	    }

        return false;
    }
1284172
public static function autoload($class)
    {
        // Don't interfere with other autoloaders
        if (0 !== strpos($class, 'Swift_')) {
            return;
        }

        $path = __DIR__.'/'.str_replace('_', '/', $class).'.php';

        if (!file_exists($path)) {
            return;
        }

        require $path;

        if (self::$inits && !self::$initialized) {
            self::$initialized = true;
            foreach (self::$inits as $init) {
                call_user_func($init);
            }
        }
    }
921233
protected static function loadMappings(/*# string */ $class)
    {
        // mapping status changed ?
        if (self::isStatusUpdated()) {
            self::resetMappings();
            self::setStatus(false);
        }

        // $class' mapping loaded already
        if ($class::hasMappings()) {
            return;
        }

        // load $class mapping
        $loadedClass = $class::hasLoader();
        if ($loadedClass) {
            // loader found
            $class::setMappings(
                $loadedClass::getLoader()->loadMessages($class)
            );
        } else {
            // no loader found
            $class::setMappings([]);
        }
    }
610625
public function load($class)
    {
        if ($this->psr0 and $this->loadPsr0($class)) {
            return true;
        }
        $namespace = '\\';
        $classPath = str_replace('\\', '/', $class) . '.php';
        while (true) {
            if ($this->loadFrom($classPath, $namespace)) {
                return true;
            }
            $pos = strpos($classPath, '/');
            if ($pos === false) {
                if (! $this->psr0) {
                    break;
                }
                $pos = strpos($classPath, '_');
                if ($pos === false) {
                    break;
                }
            }
            $namespace = rtrim($namespace, '\\') . '\\' . substr($classPath, 0, $pos);
            $classPath = substr($classPath, $pos + 1);
        }
        return false;
    }
365423
public function loadClass($class)
    {
        if (!isset($this->map[$class]) && $this->isNormalTrait($class)) {
            $path = $this->getFilePathFromClassPath($class);
            $dir = dirname($path);

            if (!is_dir($dir)) {
                if (file_exists($dir)) {
                    throw new \Exception($dir . ' is a file...');
                } else {
                    mkdir($dir, 0755, true);
                }
            }

            $result = file_put_contents(
                $path, sprintf(
                    "<?php\n\nnamespace %s;\n\ntrait %s\n{\n}\n", str_replace('/', '\\', dirname(str_replace('\\', '/', $class))), pathinfo($path)['filename']
                )
            );

            if ($result !== false || $result !== '') {
                ++$this->count;
                $this->output->writeln(sprintf('Generated trait %s', $path));
            }

            $this->map[$class] = $path;
        }

        if (isset($this->map[$class])) {
            include $this->map[$class];
        }
    }
701075
public static function load($class)
    {
        if (stripos($class, 'Phpass') === 0) {
            $file = str_replace('\\', '/', $class);

            if (file_exists(dirname(__FILE__) . '/../' . $file . '.php')) {
                require_once(dirname(__FILE__) . '/../' . $file . '.php');
            }
        }
    }
715474
public function loadClass($class)
    {
        if (0 === strpos($class, 'Admingenerated')) {
            $file_path = $this->base_path.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';

            if (!file_exists($file_path)) {
                $this->generateEmptyController($class);
            }

            if (file_exists($file_path)) {
                require $file_path;
            }
        }
    }
1238016
public function load($class)
    {
        $path = str_replace('\\', DS, $class);
        $path = '##replace##/' . trim($path, DS) . '.php';
        $path = str_replace('/', DS, $path);

        foreach ($this->getLocations() as $subPath) {
            $actualPath = str_replace('##replace##', $subPath, $path);
            if (file_exists($actualPath)) {
                require_once $actualPath;
                return true;
            }
        }
        return false;
    }
642408
public function loadClass($class)
    {
        if (strpos($class, self::ANNOTATION_NAMESPACE) === 0) {
            $class = str_replace(self::ANNOTATION_NAMESPACE, '', $class);

            $file = __DIR__ . '/' . $class . '.php';
            if (file_exists($file)) {
                require_once $file;

                return true;
            }
        }
    }
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);
            }
        }
    }
1267762
public function load($class)
    {
        $result = false;

        //Get the path
        $path = $this->getPath( $class, $this->_base_path);

        if ($path !== false)
        {
            if (!in_array($path, get_included_files()) && file_exists($path))
            {
                require $path;

                if($this->_debug)
                {
                    if(!$this->isDeclared($class))
                    {
                        throw new RuntimeException(sprintf(
                            'The autoloader expected class "%s" to be defined in file "%s".
                            The file was found but the class was not in it, the class name
                            or namespace probably has a typo.', $class, $path
                        ));
                    }
                }
            }
            else $result = false;
        }

        return $result;
    }
1011537
public function autoload($class)
    {
        $isFallback = $this->isFallbackAutoloader();
        if (false !== strpos($class, self::NS_SEPARATOR)) {
            if ($this->loadClass($class, self::LOAD_NS)) {
                return $class;
            } elseif ($isFallback) {
                return $this->loadClass($class, self::ACT_AS_FALLBACK);
            }
            return false;
        }
        if (false !== strpos($class, self::PREFIX_SEPARATOR)) {
            if ($this->loadClass($class, self::LOAD_PREFIX)) {
                return $class;
            } elseif ($isFallback) {
                return $this->loadClass($class, self::ACT_AS_FALLBACK);
            }
            return false;
        }
        if ($isFallback) {
            return $this->loadClass($class, self::ACT_AS_FALLBACK);
        }
        return false;
    }
1246662
protected function loadInstanceFromClass($class) {
        $arguments = $this->getConfiguration() [ AbstractFileConfiguration::SERVICE_INIT_ARGUMENTS ] ?? NULL;
        $config = $this->getConfiguration() [ AbstractFileConfiguration::SERVICE_INIT_CONFIGURATION ] ?? NULL;

        $this->instance = $this->serviceManager->makeServiceInstance($class, $arguments, $config);
    }