-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoload.php
More file actions
33 lines (22 loc) · 750 Bytes
/
Copy pathautoload.php
File metadata and controls
33 lines (22 loc) · 750 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
28
29
30
31
32
33
<?php
namespace Pronode;
/**
* Vendor class autoloader
*/
function vendorAutoloader($class) {
if (DIRECTORY_SEPARATOR == '/') $class = str_replace('\\', '/', $class); # unix
$path = __DIR__.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.$class.'.php';
if (file_exists($path)) include_once $path;
}
/**
* Native class autoloader
*/
function nativeAutoloader($class) {
if (DIRECTORY_SEPARATOR == '/') $class = str_replace('\\', '/', $class); # unix
$path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$class.'.php';
if (file_exists($path)) include_once $path;
}
spl_autoload_register('Pronode\vendorAutoloader');
spl_autoload_register('Pronode\nativeAutoloader');
// Additional files:
include_once 'Functions.php';