note 93958 added to function.spl-autoload
| From: | tchernoben at gmail dot com | Date: | Thu, 08 Oct 2009 14:00:39 +0000 |
| Subject: | note 93958 added to function.spl-autoload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161508@lists.php.net to get a copy of this message | ||
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
----
Server IP: 64.71.164.2
Probable Submitter: 80.94.101.83
----
Manual Page -- http://www.php.net/manual/en/function.spl-autoload.php
Edit -- https://master.php.net/note/edit/93958
Del: integrated -- https://master.php.net/note/delete/93958/integrated
Del: useless -- https://master.php.net/note/delete/93958/useless
Del: bad code -- https://master.php.net/note/delete/93958/bad+code
Del: spam -- https://master.php.net/note/delete/93958/spam
Del: non-english -- https://master.php.net/note/delete/93958/non-english
Del: in docs -- https://master.php.net/note/delete/93958/in+docs
Del: other reasons-- https://master.php.net/note/delete/93958
Reject -- https://master.php.net/note/reject/93958
Search -- https://master.php.net/manage/user-notes.php