You are here

public function ClassLoader::findFile in Mobile Number 7

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 include/ClassLoader.php
Loads the given class or interface.

File

include/ClassLoader.php, line 355

Class

ClassLoader
ClassLoader implements a PSR-0, PSR-4 and classmap class loader.

Namespace

mobile_number

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;
}