You are here

class Github_Autoloader in Bibliography Module 7.2

Autoloads Github classes

Hierarchy

Expanded class hierarchy of Github_Autoloader

File

modules/CiteProc/Github/Autoloader.php, line 6

View source
class Github_Autoloader {

  /**
   * Registers Github_Autoloader as an SPL autoloader.
   */
  public static function register() {
    ini_set('unserialize_callback_func', 'spl_autoload_call');
    spl_autoload_register(array(
      new self(),
      'autoload',
    ));
  }

  /**
   * Handles autoloading of classes.
   *
   * @param  string  $class  A class name.
   *
   * @return boolean Returns true if the class has been loaded
   */
  public static function autoload($class) {
    if (0 !== strpos($class, 'Github')) {
      return;
    }
    if (file_exists($file = dirname(__FILE__) . '/../' . str_replace('_', '/', $class) . '.php')) {
      require $file;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Github_Autoloader::autoload public static function Handles autoloading of classes.
Github_Autoloader::register public static function Registers Github_Autoloader as an SPL autoloader.