Re: Namespace issues
| From: | Kristian Koehntopp | Date: | Thu, 16 May 2002 11:58:21 +0000 |
| Subject: | Re: Namespace issues | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6136@lists.php.net to get a copy of this message | ||
On Thu, May 16, 2002 at 01:34:12PM +0200, Martin Jansen wrote:
> >> For PEAR developers:
> >> Any PEAR class that needs URLs may use names below the
> >> /internal-pear/<classname>/ branch in a webservers URL
> >> namespace tree."
> >
> >I would prefer to let the user decide where he wants to put its images on
> >his server. So I would favour a setImageDirectory() method.
>
> Right now it's very common in PEAR to use a constant for this:
>
> define("PEAR_DATA_DIR", $_SERVER['DOCUMENT_ROOT'] .
> "/internal-pear");
>
> would be an example for this.
Ok, so there is a method to _change_ this. But what is the
default?
Also, this does not cover the GPC and global namespace issues.
I just skimmed the style guide, and found
http://pear.php.net/manual/en/standards.naming.php
which states
----
Global variables
If your package needs to define global variables, their name
should start with a single underscore followed by the package
name and another underscore. For example, the PEAR package uses
a global variable called $_PEAR_destructor_object_list.
----
This does not create a common PEAR prefix, but instead a lot of
delocalized insular namespace pollutions. This may work with
globals, but is unacceptable with URLs. Even for globals and
GPCs it may be preferable to have a common prefix.
Kristian
--
http://www.amazon.de/exec/obidos/wishlist/18E5SVQ5HJZXG