Last active
December 24, 2018 06:11
-
-
Save AndrewChamp/4053e080a59ba71a8804 to your computer and use it in GitHub Desktop.
PHP Autoloader - Includes files for classes that are instantiated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
spl_autoload_register(function($class){ | |
$directorys = array(PATH.VERSION.MODULES, INSTALL.MODULES, INSTALL.THEME.'modules/'); | |
foreach($directorys as $directory): | |
if(file_exists($directory.'class.'.$class.'.php')): | |
require($directory.'class.'.$class.'.php'); | |
return; | |
endif; | |
endforeach; | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment