Re: Getting a list of registered namespaces.
| From: | Johannes Schlüter | Date: | Thu, 16 Jun 2011 18:30:08 +0000 |
| Subject: | Re: Getting a list of registered namespaces. | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53343@lists.php.net to get a copy of this message | ||
On Thu, 2011-06-16 at 19:54 +0200, Ferenc Kovacs wrote:
> Okay, so namespaces doesn't exists for the engine, because they are added to
> the classnames in compile-time, but we could add some --rX argument for the
> php binary, which would iterate over the classes and functions and so for a
> given extension, and fetch and list the introduced namespaces.
> what do you think?
The --rX things are reflection shortcuts, while we have one exception
(--ri) I actually don't want to pollute the options list. I don't see
the need for this. I don't really know when I need to know this
information. What is the worth?
For the one time this is needed one can use a trivial (g)awk command or
such ..
$ php --re http | awk '/Class \[.+ class .+\\/ { print gensub(/(.*)\\[^\\]+/,
"\\1", 1, $5); }'
should be simple to extend for functions, too. For some maybe more
readable as PHP script. But I still don't get when I'd need that
information.
johannes