Revision: 39740
Updated Code
at January 29, 2011 09:54 by kendsnyder
Updated Code
spl_autoload_register('autoloadByUnderscore'); function autoloadByUnderscore($class) { $pwd = dirname(__FILE__); $filename = str_replace('_','/',$class) . '.php'; $path = "$pwd/../lib/$filename"; if (is_file($path)) { require_once $path; } } // or rediculously simple: function autoloadByUnderscore($c) { require_once(dirname(__FILE__) . '/../lib/' . str_replace("_", '/', $c) . '.php'); }
Revision: 39739
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 20, 2011 07:03 by kendsnyder
Initial Code
spl_autoload_register('autoloadByUnderscore'); function autoloadByUnderscore($class) { $pwd = dirname(__FILE__); $filename = str_replace('_','/',$class) . '.php'; $path = "$pwd/../lib/$filename"; if (is_file($path)) { require_once $path; } }
Initial URL
Initial Description
Initial Title
Zend Framework style autoloader
Initial Tags
Initial Language
PHP