Skip to content

Instantly share code, notes, and snippets.

@leth
Created August 12, 2011 20:29
Show Gist options
  • Save leth/1142925 to your computer and use it in GitHub Desktop.
Save leth/1142925 to your computer and use it in GitHub Desktop.
An example autoloader
<?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