public function ClassLoader::loadClass

Same name in this branch
  1. 9.x drupal/core/vendor/composer/ClassLoader.php \Composer\Autoload\ClassLoader::loadClass()
  2. 9.x drupal/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php \Doctrine\Common\ClassLoader::loadClass()
  3. 9.x drupal/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php \Symfony\Component\ClassLoader\ClassLoader::loadClass()

Loads the given class or interface.

Parameters

string $className The name of the class to load.:

Return value

boolean TRUE if the class has been successfully loaded, FALSE otherwise.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php, line 156

Class

ClassLoader
A <tt>ClassLoader</tt> is an autoloader for class files that can be installed on the SPL autoload stack. It is a class loader that either loads only classes of a specific namespace or all namespaces and it is suitable for working…

Namespace

Doctrine\Common

Code

public function loadClass($className) {
  if ($this->namespace !== null && strpos($className, $this->namespace . $this->namespaceSeparator) !== 0) {
    return false;
  }
  require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension;
  return true;
}