Created
August 12, 2011 20:29
-
-
Save leth/1142925 to your computer and use it in GitHub Desktop.
An example autoloader
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 | |
function jelly_tests_autoload($classname) | |
{ | |
$filename = __DIR__.'/tests/classes/'. strtolower(str_replace($classname, '_', '/'))).EXT; | |
if (file_exists($filename)) | |
require_once $filename; | |
} | |
if (TRUE /* If testing is enabled */) | |
spl_autoload_register('jelly_tests_autoload'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment