Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53332 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9819 invoked from network); 16 Jun 2011 12:41:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2011 12:41:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qy0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:38428] helo=mail-qy0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/91-32650-BE9F9FD4 for ; Thu, 16 Jun 2011 08:41:16 -0400 Received: by qyk7 with SMTP id 7so111577qyk.8 for ; Thu, 16 Jun 2011 05:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=3sdaYhlThRRADI/hmUEaZRdKr+AJY1571SiurRBsUJ4=; b=MsOJdD3vXq7j3Op09uROJ1xKQnPh7P9h47jmtKEajGfG0juDBTCrM5qDm9YayRi9P6 cYBnAQpoylC26E1eoZGRSDHVCdNJrbY8FgAjWf/Afy9bZhvnR2yqp3pxrye0sRY66nSK LvA+tDRCqdLMDSZJda39rKRQUQKxjFD4yQUH4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=XmDrA49fgYD0nKM84t13pqI0DIHHGoM3tQ4pCbde5MctyIu8RyO+yQgC4ZwPZwhzjB kosriscZe2ZzVimDDN9EaYsMb88DZvrtWwGMLDRr1d6/ATfIowxq8dLO7juwRxJLq8p1 xBpZk2aF4bu/aTcL7ORsuTKcYj3Ve1Irngha4= Received: by 10.229.45.147 with SMTP id e19mr710863qcf.75.1308228073090; Thu, 16 Jun 2011 05:41:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.80.79 with HTTP; Thu, 16 Jun 2011 05:40:53 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: <4DF8DC94.5060009@sugarcrm.com> References: <4DF8DC94.5060009@sugarcrm.com> Date: Thu, 16 Jun 2011 13:40:53 +0100 Message-ID: To: Stas Malyshev Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Getting a list of registered namespaces. From: rquadling@gmail.com (Richard Quadling) On 15 June 2011 17:23, Stas Malyshev wrote: > Hi! > >> With pecl/http (DEV-2 branch) and the Functional extension (on github) >> both creating namespaces within the extension, I think there is a >> requirement for a mechanism to allow an extension to record the >> namespace(s) that it has, in a similar fashion to how functions and >> classes are known to core. > > There's no such thing as "registered namespaces", at least in the engine. > Namespace is just a part of class/function name. You could enumerate > classes/functions and split their names, but I'm not sure for what such list > will be useful. Could you explain? > >> But, trawling all the classes and functions, extracting and >> aggregating the namespace would really not seem to be the way to go. >> And that wouldn't take into account the user defined namespaces. > > Again, there's no such thing as list of user defined namespaces, at runtime. > You'd have to go through all classes/functions and split their names. Again, > I'm not sure what would be the use of it. Currently, I can find the names of functions, classes and interfaces - be they from an extension or userland code. But I can't get namespaces, or their aliases. I'm not totally sure of any other use. That's why I was asking. As (or if) more extensions start to use namespaces to protect their contents from name collision, we are probably going to have namespace collision before long. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea