public function ClassLoader::canLoadClass

Asks this ClassLoader whether it can potentially load the class (file) with the given name.

Parameters

string $className The fully-qualified name of the class.:

Return value

boolean TRUE if this ClassLoader can load the class, FALSE otherwise.

File

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

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 canLoadClass($className) {
  if ($this->namespace !== null && strpos($className, $this->namespace . $this->namespaceSeparator) !== 0) {
    return false;
  }
  $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension;
  if ($this->includePath !== null) {
    return file_exists($this->includePath . DIRECTORY_SEPARATOR . $file);
  }
  return false !== stream_resolve_include_path($file);
}