-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathautoload.php
More file actions
27 lines (26 loc) · 804 Bytes
/
autoload.php
File metadata and controls
27 lines (26 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
*
* @package mahara
* @subpackage auth-oidc
* @author James McQuillan <james.mcquillan@remote-learner.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright (C) 2015 onwards Microsoft Open Technologies, Inc. (http://msopentech.com/)
*/
/**
* Autoloader for OIDC libraries.
*
* @param string $class The requested class.
*/
function auto_oidc_autoload($class) {
$pluginbasedir = __DIR__.'/classes';
$class = trim($class, '\\');
if (strpos($class, 'auth_oidc\\') === 0) {
$file = $pluginbasedir.DIRECTORY_SEPARATOR.substr($class, 10);
$file = str_replace('\\', DIRECTORY_SEPARATOR, $file).'.php';
if (file_exists($file)) {
include_once($file);
}
}
}
spl_autoload_register('auto_oidc_autoload');