You are here

public function ClassLoader::canLoadClass in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php \Doctrine\Common\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.

1 call to ClassLoader::canLoadClass()
ClassLoader::loadClass in vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
Loads the given class or interface.

File

vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php, line 201

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 is_file($this->includePath . DIRECTORY_SEPARATOR . $file);
  }
  return false !== stream_resolve_include_path($file);
}