You are here

function xautoload_ClassLoader_NoCache::loadClass in X Autoload 7.3

Callback for class loading. This will include ("require") the file found.

Parameters

string $class: The class to load.

Overrides xautoload_ClassLoader_Interface::loadClass

1 method overrides xautoload_ClassLoader_NoCache::loadClass()
xautoload_ClassLoader_ApcCache::loadClass in lib/ClassLoader/ApcCache.php
Callback for class loading. This will include ("require") the file found.

File

lib/ClassLoader/NoCache.php, line 64

Class

xautoload_ClassLoader_NoCache
Behaves mostly like the Symfony ClassLoader classes.

Code

function loadClass($class) {
  $api = new xautoload_InjectedAPI_findFile($class);

  // $api has a ->suggestFile($file) method, which returns TRUE if the
  // suggested file exists.
  // The $finder->findFile() method is supposed to suggest a number of files
  // to the $api, until one is successful, and then return TRUE. Or return
  // FALSE, if nothing was found.
  if ($this->finder
    ->findFile($api, $class)) {

    // In case of success, the file will be in the $api, to be retrieved with
    // $api->getFile().
    require $api
      ->getFile();
  }
}