Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-03 Thread James Crumpton
Maybe I'm alone on this, but all my class files are named as Classname.class.php... (hint, hint) :) ... On second thought, maybe it would be interesting/useful to have some mechanism to allow a formatted string like "%s.foo.php" or "foo.%s.php" to be used by spl's autoload? Not really sure ho

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-03 Thread Jessie Hernandez
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

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-03 Thread Michael Wallner
Hi Marcus Boerger, you wrote: > Hello Michael, > > i suffest that pear finally takes a better approach with the arrival of > namespaces then the ugly workaround of '_'. Of course -- PEAR would benefit a lot of namespaces! -- Michael - < mike(@)php.net > signature.asc Description: OpenPGP dig

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-03 Thread Marcus Boerger
Hello Michael, i suffest that pear finally takes a better approach with the arrival of namespaces then the ugly workaround of '_'. If pear doesn#t want to i suggest pear simply writes it's own __autoload(). marcus Tuesday, August 2, 2005, 6:01:18 PM, you wrote: > Hi Jessie Hernandez, you w

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-03 Thread Marcus Boerger
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 t

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread Andi Gutmans
FYI, I haven't had a chance to look at this patch yet (nor a lot of the emails on the subject). After PHP 5.1 goes RC and we start our Unicode work, I should have time to look into it. Interesting to see if it addresses the issues we had in the past. I think some of them weren't solvable althou

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread Jessie Hernandez
Hi Michael, Yes, I am aware of this. Underscores were used due to the lack of namespaces. For user classes which use namespaces (and in the case where some PEAR classes get modified to be under namespaces), the colon would be used as the separator, and this would get replaced by the slash to form

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread Michael Wallner
Hi Jessie Hernandez, 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) With the minor but essential logical difference: $file = str

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread Jessie Hernandez
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 u

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread Jessie Hernandez
"John LeSueur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > so, if I understand correctly, if your __autoload is defined in a > different file(file1) from where the import was > called(file2), then get_imported_namespaces() returns the namespace > imports for file1. > get_impo

Re: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread John LeSueur
Jessie Hernandez wrote: Attached is the latest version of the namespace patch! It finally includes namespace imports and it even includes anonymous namespace support. Also, the previous bison shift/reduce conflict has been removed. Here is a summary of its features: - Simple imports: import ns:

RE: [PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-02 Thread David Zülke
This sounds awesome. Good job, Jessie. Keep it up! - David > -Original Message- > From: Jessie Hernandez [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 02, 2005 6:07 AM > To: internals@lists.php.net > Subject: [PHP-DEV] [PATCH] Namespace Patch, Beta 1 > > A

[PHP-DEV] [PATCH] Namespace Patch, Beta 1

2005-08-01 Thread Jessie Hernandez
Attached is the latest version of the namespace patch! It finally includes namespace imports and it even includes anonymous namespace support. Also, the previous bison shift/reduce conflict has been removed. Here is a summary of its features: - Simple imports: import ns:class1; - Import aliases: i