Re: [PATCH] Namespace Patch, Alpha 3

From: Date: Tue, 26 Jul 2005 21:54:02 +0000
Subject: Re: [PATCH] Namespace Patch, Alpha 3
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-17418@lists.php.net to get a copy of this message
On Tue, 2005-07-26 at 10:10 +0200, Marcus Boerger wrote: > > I still think the namespace import behavior should be separate from the > > __autoload function. Of course, this is just me. What does everyone else > > think? I'd like to gather opinions on which is preferred. I will also like > > to know if a separate class_path is preferred (as I have in my last patch) > > or if just leaving include_path is what most prefer. > > None of the above makes any sense. Look __autoload() is just bein called at > any place where a class is missing. So looking for the file first and then > loading __autoload(I) makes no sense whatsoever. IMO what we need here is a > default implementation for import behavior accomplished by __autoload(). So > for example "import ns:cls;" leads to "__autoload('ns:cls')". > Here the SPL > default implementation would relpace all ':' with the directory divider '/' > or '\', append '.inc' or '.php' or '.inc.php' and > append the result to all > directories in the include_path to look for the file. If were are to support > import with '*' the the autoload implementation would need to take care of > this and load all matching files. A user land implementation can easily > achieve that by using SPLs (Recursive)DirectoryIterator and FilterIterator. What are the options when having a PHP without SPL, then? That __autoload invocation chain once in discussion hasn't yet been implemented, right? Regards, -Alex

« previous php.internals (#17418) next »