Autoloading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am using __autoload for my site which is conflicting with the autoloading of PHPExcel.  I tried using spl_autoload_register thinking that might be the way to go but when I tried I got a "cannot be redeclared" error.  I include my autoload script (include_once "../../lib/autoload.php";) and my autoload.php script looks like this:
<?
	function __autoload($class_name) {
		$path="../../lib/class.$class_name.php";
		if(file_exists($path)) {
			require_once $path;
		}
	}
?>

As stated, when I change __autoload to spl_autoload_register I get the can't be redeclared error.  Any ideas?

Thanks!
Floyd


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux