You are here

public function ClassLoader::findFile in Zircon Profile 8

Same name in this branch
  1. 8 vendor/composer/ClassLoader.php \Composer\Autoload\ClassLoader::findFile()
  2. 8 vendor/symfony/class-loader/ClassLoader.php \Symfony\Component\ClassLoader\ClassLoader::findFile()
  3. 8 vendor/symfony/debug/Tests/DebugClassLoaderTest.php \Symfony\Component\Debug\Tests\ClassLoader::findFile()
Same name and namespace in other branches
  1. 8.0 vendor/composer/ClassLoader.php \Composer\Autoload\ClassLoader::findFile()

Finds the path to the file where the class is defined.

Parameters

string $class The name of the class:

Return value

string|false The path if found, false otherwise

1 call to ClassLoader::findFile()
ClassLoader::loadClass in vendor/composer/ClassLoader.php
Loads the given class or interface.

File

vendor/composer/ClassLoader.php, line 314

Class

ClassLoader
ClassLoader implements a PSR-0 class loader

Namespace

Composer\Autoload

Code

public function findFile($class) {

  // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
  if ('\\' == $class[0]) {
    $class = substr($class, 1);
  }

  // class map lookup
  if (isset($this->classMap[$class])) {
    return $this->classMap[$class];
  }
  if ($this->classMapAuthoritative) {
    return false;
  }
  $file = $this
    ->findFileWithExtension($class, '.php');

  // Search for Hack files if we are running on HHVM
  if ($file === null && defined('HHVM_VERSION')) {
    $file = $this
      ->findFileWithExtension($class, '.hh');
  }
  if ($file === null) {

    // Remember that this class does not exist.
    return $this->classMap[$class] = false;
  }
  return $file;
}