Re: YANP (Yet Another Namespace Proposal)
| From: | Jessie Hernandez | Date: | Mon, 18 Jul 2005 05:08:09 +0000 |
| Subject: | Re: YANP (Yet Another Namespace Proposal) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17304@lists.php.net to get a copy of this message | ||
As requested by others, attached is a cvs patch that includes the latest
namespace additions and PHP test files. With this patch, the following
features have been added:
1) import statements now include the class files, using a new .ini variable,
"class_path"!
2) Near-full support of private classes! Currently, private classes cannot
be used outside their namespace, but can be used within methods of classes
within the namespace. What's left for me to do is to allow private classes
to be extended from other classes in the same namespace (this is almost
complete in this patch, it works if both classes are defined in the same
file). Private classes are declared simply as "private class_name" within a
namespace (if the "private" keyword is applied to a class in the global
namespace, an error will be generated).
Aside from what's pending in #2, I think the only missing feature is
"namespace imports". I'd like to gather thoughts from others as how this
can be best implemented (some issues have been raised as how namespace
imports will work with opcode caches). I'll post a few possible approaches
some other day this week (I'm tired now ;-)).
BTW, I tried to do a "cvs add" to add my test files, but of course, it
failed with an "cvs add requires write access to repository" error. Hence,
I had to zip up the files separately. How can I add new files locally so
that cvs diff picks them up in the patch?
Regards,
Jessie Hernandez
Attachment: [text/x-diff] ns_0718.patch
Attachment: [application/x-gzip] tests.tar.gz
Attachment: [text/x-diff] ns_0718.patch
Attachment: [application/x-gzip] tests.tar.gz