RE: [PEAR-DEV] Contribution for PECL

From: Date: Sat, 28 Dec 2002 15:04:18 +0000
Subject: RE: [PEAR-DEV] Contribution for PECL
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11880@lists.php.net to get a copy of this message
> -----Original Message----- > From: Sterling Hughes [mailto:sterling@bumblebury.com] > Sent: Saturday, December 28, 2002 3:54 PM > To: Lukas Smith > Cc: pear-dev@lists.php.net > Subject: Re: [PEAR-DEV] Contribution for PECL > > > > > There is nothing in PEAR/PECL for all I know that forces you to add > > "meaningless" prefix to make possible future name classes unlikely. As > > far as I know even the non "core" php extensions don't have any such > > prefixes, nor do PEAR packages that have no competition. > > > > But it does require a prefix, to be meaningful and unique. > > > Moreover it is common practice that the package/extension that comes > > second has to worry about that. > > > > Like "MDB" because it came after "DB" .. I don't have a good > > example for > > a php extension atm (and I am too lazy to think of one ... hmm maybe > > "mbstring"). > > > > Well, as you note PEAR classes are different than extensions. If you have > a non-standard extension installed, and you are someone developing a 3rd > party application that uses a templating system that uses a (not uncommon) > prefix like tmpl_*, the third party application will not run. Once an > extension is installed, that namespace is claimed for *all* instances of > the > PHP interpreter on all scripts. > > My suggestion would be to give the templating system a name (other than > tmpl, template, whatever), and then prefix it with that name. > > > Anyways if there needs to be a prefix I generally would preefer it to > > imply something about the approach "mb" stands for "multi byte" iirc in > > the "mbstring" name. > > mbstring is a bit of a different case, simply because its a standard > extension > (and most applications don't have their own multibyte functions defined in > PHP), therefore it can claim that namespace better. Everyone and there > cousins > have some sort of messed up templating system (sic.), therefore claiming > such > a common namespace in a non-standard (non-popular) extension is not the > wisest > approach. > So short and snappy names are reserved for 3rd Party Wrapper extensions (where the 3rd party name is "unique" enough like "MySQL", "MSSQL") or extensions that are introduced by core developers that have been planned to become standard. All other extensions should be prefixed by something meaningless? I understand the logic, but I don't think it is in any doc. If anyone has the time to write something up that would be good. Regards, Lukas

« previous php.pear.dev (#11880) next »