Created
February 12, 2017 18:02
-
-
Save racztiborzoltan/9cf287b78a1c80a69944a1f57b5ba4fb to your computer and use it in GitHub Desktop.
Simple PSR0 autoloader function
This file contains 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_name){ | |
$path = realpath(__DIR__.'../../classes/'. str_replace('\\', '/', $class_name).'.php'); | |
if ($path) { | |
require_once $path; | |
} | |
return class_exists($class_name, false); | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment