Return to Snippet

Revision: 16059
at July 24, 2009 13:46 by iTony


Initial Code
<?php

set_include_path(realpath('/path/to/lib') . PATH_SEPARATOR . get_include_path());

function autoload($className)
{
		require($className . '.php');
}

spl_autoload_register('autoload');

$Database = new Database();

?>

Initial URL
http://www.brandonsavage.net/making-life-better-with-the-spl-autoloader/

Initial Description
check out why the get_include_path() was appended to the new path.

Initial Title
SPL_autoload example script

Initial Tags
php

Initial Language
PHP