note 93958 deleted from function.spl-autoload by danbrown
| From: | danbrown@php.net | Date: | Thu, 08 Oct 2009 14:31:38 +0000 |
| Subject: | note 93958 deleted from function.spl-autoload by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161518@lists.php.net to get a copy of this message | ||
Note Submitter: tchernoben at gmail dot com
----
There is a better alternative to load automaticaly differents class files by using
spl_autoload_extensions :
<?php
set_include_path( './common'
. PATH_SEPARATOR . './common/classes'
. PATH_SEPARATOR . './config'
. PATH_SEPARATOR . './library'
. PATH_SEPARATOR . './library/classes'
. PATH_SEPARATOR . './application/models'
. PATH_SEPARATOR . get_include_path()
);
spl_autoload_extensions(
'.inc,'
. '.php,'
. '.class.php'
);
spl_autoload_register();
?>
This way you'll be able to load class files like myClass.class.php