Autoloader.php in Bibliography Module 7.2
File
modules/CiteProc/Github/Autoloader.phpView 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
Name | Description |
---|---|
Github_Autoloader | Autoloads Github classes |