Re: [PATCH] Namespace Patch, Beta 1
| From: | Jessie Hernandez | Date: | Wed, 03 Aug 2005 20:40:08 +0000 |
| Subject: | Re: [PATCH] Namespace Patch, Beta 1 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17516@lists.php.net to get a copy of this message | ||
Hello Marcus,
This simple change will make class imports work out of the box, which is
pretty good. What won't work out of the box are namespace imports. I think
we should provide this also (using the same logic as I'm using in
namespace_autoload.php). Even though this will complicate the default
spl_autoload function, namespace imports would work by default and will be
faster than the userland code. I'll try to add the spl_autoload changes in
my patch in the next few days.
Also, I just looked at the php_spl.c code, is there any reason why .php is
not in the list of default extensions? It'd be nice if the default
extensions were .php, .inc, and .inc.php.
Best regards,
Jessie
"Marcus Boerger" <helly@php.net> wrote in message
news:13210444107.20050803190850@marcus-boerger.de...
> Hello Jessie,
>
> what ever you want auto-of-the-box is good. I suggest the simplest
> possible way as default which is we simply stay like we are doing now and
> only include a replacement from ':' to the current directory separator.
> That we would be searching for '.inc' and '.inc.php' per default in the
> include_path directories.
>
> marcus
>
> Tuesday, August 2, 2005, 5:17:45 PM, you wrote:
>
> > Forgot to mention, since I expect the majority of users to follow the
PEAR
> > convention for their classes (basically one class per file, file is
named
> > like class, with "namespace" directories), then maybe a default
> > implementation can be provided in SPL's autoload. That way, namespace
> > imports can be used "out of the box".
>
> > Marcus, what do you think?
>
>
> > Regards,
>
> > Jessie Hernandez
>
>
>
>
> Best regards,
> Marcus