Skip to content

Instantly share code, notes, and snippets.

@goldhat
Created June 4, 2017 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goldhat/19b4756edb1b2a0dacb6b8982618907c to your computer and use it in GitHub Desktop.
Save goldhat/19b4756edb1b2a0dacb6b8982618907c to your computer and use it in GitHub Desktop.
quizmaster_extension_autoload.php
public static function autoload( $class, $dir ) {
$registeredExtensions = $this->register();
print '<pre>';
var_dump( $registeredExtensions );
print '</pre>';
foreach( $registeredExtensions as $ext => $extSettings ) {
if( $extSettings['type'] == 'pro' ) {
$classPath = QUIZMASTER_PATH . '/pro/extensions/' . $ext . '/lib/' . $dir . '/' . $class . '.php';
print '<pre>';
var_dump( $classPath );
print '</pre>';
if (file_exists($classPath)) {
include_once $classPath;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment