You are here

function autoload_class in Autoload 6

Same name and namespace in other branches
  1. 6.2 autoload.module \autoload_class()

Autoload function for registered classes.

2 string references to 'autoload_class'
autoload_enable in ./autoload.install
Implementaton of hook_enable().
autoload_init in ./autoload.module
Implementation of hook_init().

File

./autoload.module, line 20

Code

function autoload_class($class) {
  $lookup = autoload_get_lookup();
  if (!empty($lookup[$class])) {

    // require() is safe because if the file were already included
    // autoload wouldn't have been triggered.
    $path = realpath($lookup[$class]);
    if (!empty($path)) {
      require $path;
    }
  }
}