Re: Autoloading
| From: | Marco Behnke | Date: | Wed, 01 Feb 2012 14:24:05 +0000 |
| Subject: | Re: Autoloading | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316445@lists.php.net to get a copy of this message | ||
Am 26.01.2012 15:44, schrieb Floyd Resler:
Attachment: [application/pkcs7-signature] S/MIME Kryptografische Unterschrift smime.p7s
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@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz
Attachment: [application/pkcs7-signature] S/MIME Kryptografische Unterschrift smime.p7s