note 84148 deleted from language.namespaces by philip
| From: | philip@php.net | Date: | Fri, 28 Nov 2008 18:50:34 +0000 |
| Subject: | note 84148 deleted from language.namespaces by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147101@lists.php.net to get a copy of this message | ||
Note Submitter: yarco dot w at gmail dot com
----
So do you mean if i want to use a class, i need to do extra two steps?
1) require/include that file
2) use the namespace
What about to add a trigger something like:
function __auto_namespace($names, $class)
{
if ($class === null)
{
set_include_dir(implode('/', $names));
}
else
{
require_once implode('/', $names).'/'.$class.'.php';
}
}
Then when we:
use NAMESPACE1::NAMESPACE2;
or
use NAMESPACE1::NAMESPACE2::CLASS1;
php could auto include the file we needed.