You are here

Autoloader.php in Bibliography Module 7.2

File

modules/CiteProc/Github/Autoloader.php
View source
<?php

/**
 * Autoloads Github classes
 */
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;
    }
  }

}

Classes

Namesort descending Description
Github_Autoloader Autoloads Github classes