[PHP-DEV] Interfaces name "Interface", was: [PHP-DEV] Re: Idea for namespace lookup resolution

2007-12-31 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I started a scratch project with this patch and working with it seems intuitive so far. My only question at the moment is the following, however I guess it isn't specific to your NS patch then to Dmitry's: My current practice to declare an inter

Re: [PHP-DEV] Re: Idea for namespace lookup resolution

2007-12-18 Thread Jessie Hernandez
Attached is a patch implementing my proposal. Basically, when inside a namespace, you must reference global classes using ::globalName or by having a "use ::globalName" statement. This allows classes inside namespaces to have the same name as internal ones without the need of explicitly "use"-

Re: [PHP-DEV] Re: Idea for namespace lookup resolution

2007-12-17 Thread Jessie Hernandez
Dmitry, As I mentioned, I did not find any significant performance penalty with this patch. Also, the patch can be improved by not checking the __get_namespace_classes function if we are not currently inside a namespace. Either way, if we ignore namespace imports, then the best solution would

Re: [PHP-DEV] Re: Idea for namespace lookup resolution

2007-12-17 Thread Dmitry Stogov
Hi Jessie, The namespace may include several files and it may be extended with additional files in any moment. So having single __get_namespace_classes() function will require to update it every time you extend namespace. Also such function will significantly slowdown access to internal cla

[PHP-DEV] Re: Idea for namespace lookup resolution

2007-12-14 Thread Jessie Hernandez
Attached is the proof-of-concept patch. If the idea is met well, then I'll keep working on it to add caching and, if there's interest, I'll add *namespace imports*. An example of how a class in a namespace that's named the same as an internal class can be loaded: autoload.php include_onc

[PHP-DEV] Re: Idea for namespace lookup resolution

2007-12-11 Thread Gregory Beaver
Jessie Hernandez wrote: > I just thought of something that might be a solution to the lookup rules > that we currently have in the namespaces implementation. Whether it's > good or not, I just wanted to throw it out there. Here goes: > > Support a user-defined function named __get_namespace_classe