mirror of
https://github.com/glmdev/eecs448-lab10
synced 2026-03-02 03:39:24 +00:00
Initial commit
This commit is contained in:
20
common/autoload.php
Normal file
20
common/autoload.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
class AutoLoad {
|
||||
public static function load($class_name) {
|
||||
$file = str_replace("\\", '/', $class_name) . '.php';
|
||||
$path = system_path($file);
|
||||
|
||||
if ( file_exists($path) ) {
|
||||
include_system($file, false);
|
||||
|
||||
if ( class_exists($class_name) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
spl_autoload_register('AutoLoad::load');
|
||||
Reference in New Issue
Block a user