Loads the given class or interface.

@param string $className The name of the class to load.

@return boolean TRUE if the class has been successfully loaded, FALSE otherwise.
973140
public function loadClass($className)
    {
        if (self::typeExists($className)) {
            return true;
        }

        if ( ! $this->canLoadClass($className)) {
            return false;
        }

        require($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
               . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
               . $this->fileExtension;

        return self::typeExists($className);
    }
21263
public function loadClass( $class ) {

		if ( ! isset( $this->class_map[ $class ] ) )
			return FALSE;

		return $this->loader->loadFile( $this->class_map[ $class ] );
	}
1000094
public function autoload($className)
    {
        $pluginName = strtolower(substr($className, 0, strpos($className, '_')));

        if ($this->load($pluginName))
        {
            $filename = Eresus_Kernel::app()->getFsRoot() . '/ext/' . $pluginName . '/classes/' .
                str_replace('_', '/', substr($className, strlen($pluginName) + 1)) . '.php';
            if (file_exists($filename))
            {
                /** @noinspection PhpIncludeInspection */
                include $filename;
                return Eresus_Kernel::classExists($className);
            }
        }

        return false;
    }
1125925
public static function loader($className)
    {
        if ($path = self::getClassPath(ltrim($className, '\\'))) {
            /** @noinspection PhpIncludeInspection */
            require_once $path;

            return true;
        }

        return false;
    }
1229302
final public static function clearInstance($className)
  {
    if (isset(self::$_instances[$className])) {
      $name = self::_configName($className);
      Config::clearInstance($name);

      self::$_instances[$className]->_loadObservers();
    }
  }
360605
public function loadClass($className)
    {

        // concatenate namespace and separator
        $namespaceAndSeparator = $this->namespace . $this->namespaceSeparator;

        // if a namespace is available OR the classname contains a namespace
        if ($namespaceAndSeparator === substr($className, 0, strlen($namespaceAndSeparator)) || $this->namespace === null) {
            // initialize filename, classname and namespace
            $fileName = '';
            $namespace = '';
            if (($lastNsPos = strripos($className, $this->namespaceSeparator)) !== false) {
                $namespace = substr($className, 0, $lastNsPos);
                $className = substr($className, $lastNsPos + 1);
                $fileName = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
            }

            // prepare filename
            $fileName .= $className . $this->fileExtension;

            // try to load the requested class
            $toRequire = $this->includePath . DIRECTORY_SEPARATOR . $fileName;
            $psr4FileName = $this->includePath . DIRECTORY_SEPARATOR . ltrim(strstr(ltrim(strstr($fileName, DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR);

            // query whether or tno the file exsists
            if (file_exists($toRequire)) {
                // require the file and return TRUE
                require $toRequire;
                return true;

            } elseif (file_exists($psr4FileName) && !is_dir($psr4FileName)) {
                // require the file and return TRUE
                require $psr4FileName;
                return true;
            }
        }
    }
190964
public final function load(string $className): bool
    {
        parent::load($className);
        if ($this->psr4->load($className)
         || $this->classMap->load($className)) {
            return true;
        }
        return false;
    }
674468
public static function isClassAbstract($className)
    {
        if (!class_exists($className)) {
            return false;
        }

        $reflectionClass = new \ReflectionClass($className);

        return $reflectionClass->isAbstract();
    }
843779
public function hasObjectManagerByClassName($className)
    {
        $realClass = ClassUtils::getRealClass($className);

        if ($this->hasObjectManagerNameByClassName($realClass)) {
            $objectManagerName = $this->getObjectManagerNameByClassName($realClass);
            return $this->getDoctrineObjectManager()->has($objectManagerName);
        }
        return false;
    }
1206213
public function loadClass($className)
    {
        $className = ltrim($className, '\\');

        $namespaceParts = explode('\\', $className);
        // Workaround for Doctrine's annotation parser which does a class_exists() for annotations like "@param" and so on:
        if (isset($this->ignoredClassNames[$className]) || isset($this->ignoredClassNames[end($namespaceParts)])) {
            return false;
        }

        // Loads any known proxied class:
        if ($this->classesCache !== null && ($this->availableProxyClasses === null || isset($this->availableProxyClasses[implode('_', $namespaceParts)])) && $this->classesCache->requireOnce(implode('_', $namespaceParts)) !== false) {
            return true;
        }

        return false;
    }
1341405
public function classname($classname = null)
    {
        if ($classname === null) {
            return $this->classname;
        }

        $this->classname = $classname;
    }
736900
protected function load($className, $code)
    {
        if (class_exists($this->getFullClassName($className), false)) {
            return;
        }

        eval('?>'.$code);
    }
264376
public function isClass($className)
    {
        foreach ($this->definitions as $key => $value) {
            if (!strcasecmp($key, $className) && 'class' === $value->getType()) {
                return true;
            }
        }

        /*
         * Try to autoload the class from an external dependency
         */
        if (\count($this->externalDependencies)) {
            foreach ($this->externalDependencies as $namespace => $location) {
                if (preg_match('#^'.$namespace.'\\\\#i', $className)) {
                    return $this->loadExternalClass($className, $location);
                }
            }
        }

        return false;
    }
570621
protected function loadClass($className)
    {
        if (strpos($className, NS) !== false) {
            $className = str_replace(NS, DS, ltrim($className, NS));
        }

        $filename = str_replace('_', DS, $className) . '.php';

        if (array_key_exists($className, $this->includePaths)) {
            @require_once $this->includePaths[$className];

            if (class_exists('\\' . trim("$className", '\\'))) {
                return true;
            }
        }

        foreach ($this->includePaths as $namespace => $includePath) {
            if (file_exists($includePath . $filename)) {
                require_once $includePath . $filename;

                return true;
            }
        }

        return false;
    }
541286
protected static function getObject($className)
    {
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = self::createObject($className);
        }

        return self::$instances[$className];
    }
813074
private function tryLoadClass($className, $file)
    {
        if ($this->isLoaded($className)) {
            return true;
        }
        $this->logger->debug(
            'Trying to load {class} (should be located in file {file}).',
            array('class' => $className, 'file' => $file)
        );

        try {
            $this->loader->loadClass($className);
            if (!$this->loader->isClassFromFile($className, $file)) {
                $this->logger->warning(
                    '{class} was loaded from {realFile} (should be located in file {file}).',
                    array(
                        'class' => $className,
                        'file' => $file,
                        'realFile' => $this->loader->getFileDeclaringClass($className)
                    )
                );
            }

            return true;
        } catch (ClassNotFoundException $exception) {
            $this->logger->error(
                'The autoloader could not load {class} (should be located in file {file}).',
                array('class' => $className, 'file' => $file)
            );
        } catch (\ErrorException $exception) {
            $this->logger->error(
                'Loading class {class}  failed with reason: {error}.',
                array('class' => $className, 'error' => $exception->getMessage())
            );
        }

        return false;
    }
1158492
public static function getInstance($className)
    {
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = new self($className);
        }

        return self::$instances[$className];
    }