Re: Autoloading

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

 



Am 26.01.2012 15:44, schrieb Floyd Resler:
> As stated, when I change __autoload to spl_autoload_register I get the can't be redeclared error. Any ideas?


Try

$callback = function($class_name) {
	$path = dirname(__FILE__)."/../../lib/class.{$class_name}.php";
	if (file_exists($path)) {
		require_once $path;
	}
};

spl_autoload_register($callback);



--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: marco@xxxxxxxxxx

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

<<attachment: smime.p7s>>


[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