note 114042 added to function.spl-autoload-register
| From: | hajo-p | Date: | Sun, 05 Jan 2014 17:25:09 +0000 |
| Subject: | note 114042 added to function.spl-autoload-register | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198120@lists.php.net to get a copy of this message | ||
sorry my last comment contained an error and might be deleted. this is the corrected version:
if you have a dir-structure like "/abc/def/ghi", your index.php lies in the top directory,
but you want to use namespaces starting with "def" or "ghi":
you can switch the namespace root directory of php with e.g. set_include_path(__DIR__ .
'/abc') and afterwards define + use your namespaces with the simple
spl_autoload_register() function without any arguments supplied.
remember that php handlers "cli" and "cli-server" are special cases.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.spl-autoload-register.php
Edit -- https://master.php.net/note/edit/114042
Del: integrated -- https://master.php.net/note/delete/114042/integrated
Del: useless -- https://master.php.net/note/delete/114042/useless
Del: bad code -- https://master.php.net/note/delete/114042/bad+code
Del: spam -- https://master.php.net/note/delete/114042/spam
Del: non-english -- https://master.php.net/note/delete/114042/non-english
Del: in docs -- https://master.php.net/note/delete/114042/in+docs
Del: other reasons-- https://master.php.net/note/delete/114042
Reject -- https://master.php.net/note/reject/114042
Search -- https://master.php.net/manage/user-notes.php