forked from Geekcrowds/provisioner
-
Notifications
You must be signed in to change notification settings - Fork 15
/
autoload.php
executable file
·41 lines (36 loc) · 1.01 KB
/
autoload.php
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* SPL Auto-loader
*
* @author Darren Schreiber
* @author Francis Genet
* @license MPL / GPLv2 / LGPL
* @package Provisioner
*/
class ProvisionerConfig {
/**
* Setup anything required to make our provisioner class work
*/
public static function setup() {
// Register auto-loader. When classes are requested that aren't loaded
spl_autoload_register(array(
'ProvisionerConfig',
'autoload'
));
}
public static function autoload($class) {
// If for some reason we get here and the class is already loaded, return
if (class_exists($class, FALSE)) {
return TRUE;
}
// Try to include the class
$file = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
if (is_file(PROVISIONER_BASE . $file)) {
require_once(PROVISIONER_BASE . $file);
return TRUE;
}
return FALSE;
}
}
ProvisionerConfig::setup();
require_once 'simple_twig.php';