Re: [PATCH] Namespace Patch, Alpha 3

From: Date: Tue, 26 Jul 2005 19:08:44 +0000
Subject: Re: [PATCH] Namespace Patch, Alpha 3
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-17412@lists.php.net to get a copy of this message
Hello Jessie, Tuesday, July 26, 2005, 8:59:55 PM, you wrote: > "Marcus Boerger" <mail@marcus-boerger.de> wrote in message > news:03165207.20050726101137@marcus-boerger.de... >> Hello Weyert, >> >> Tuesday, July 26, 2005, 10:04:28 AM, you wrote: >> >> > Hello, >> >> > How can I use the namespaces support, in such way that I can use with my >> > coding guideline? >> >> > interfaces -> interface.NAME.inc.php >> > classes -> class.NAME.inc.php >> >> > It doesn't seem it's possible now, because it's hard coded against >> > NAME.php. Oh well, I might will have >> > a look at it, and try to come with some workable, with support for >> > nameless namespaces, etc. >> >> >> I have the same probelm and don't see any reason in a hard coded >> naming scheme unless be it a default fallback. Look at my other >> reply. >> >> Best regards, >> Marcus > Based on what I see above, there appears to be several users which do not > follow the PEAR file naming convention for their own classes. In order to > have flexibility in this area, we are forced to let __autoload handle the > include logic. I will post a patch in a few days with this change (as a > result, my patch will be much smaller). I will also add the namespace import > logic as described in my other post. Basically, the user will be responsible > for all importing behavior in __autoload. > In order for namespace imports to work correctly, an additional parameter > needs to be passed to __autoload that will contain an array of imported > namespaces from the file that triggered the __autoload call. Does anyone see > any problems with this additional argument? This argument would only be > passed if the class name does not contain a colon (meaning that the class > could *possibly* reside under one of these namespaces). Yes you cannot simply change signatures of internal functions. And also you don't need to since you can easily provide a helper function(s) or you can give direct access to the list itself. Best regards, Marcus

« previous php.internals (#17412) next »