mirror of
https://github.com/glmdev/eecs448-lab10
synced 2024-10-27 19:14:00 +00:00
21 lines
422 B
PHP
21 lines
422 B
PHP
<?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');
|