This repository has been archived on 2026-11-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
eecs448-lab10/common/autoload.php

21 lines
422 B
PHP
Raw Normal View History

2020-12-06 13:58:02 -06:00
<?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');