Re: Call for Votes: JSON location

From: Date: Sat, 08 Apr 2006 22:31:58 +0000
Subject: Re: Call for Votes: JSON location
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42173@lists.php.net to get a copy of this message
Pierre wrote: > On Fri, 07 Apr 2006 22:14:44 -0500 > cellog@php.net (Greg Beaver) wrote: > > >>Pierre wrote: >> >>>On 4/8/06, Daniel Convissor <danielc@analysisandsolutions.com> >>>wrote: >>> >>> >>>>Hi Pierre! >>>> >>>>On Fri, Apr 07, 2006 at 11:57:43PM +0200, Pierre wrote: >>>> >>>> >>>>>What's about a one to one mapping to pecl/json? >>>> >>>>I can interpret this to mean a few different things. Can you >>>>explain exactly what you're thinking, please? >>> >>> >>>In short: >>> >>>if (!extension_loaded('json')) include 'JSON.php'; >>> >>>--Pierre >> >>From an extensibility standpoint, this seems to me a bad idea. > > There is not really anything to extend. > >>If the json extension were to change the way the code works or >>introduce a bug (heaven forbid), there would be no easy way to fall >>back to JSON.php if the json extension were loaded, as they would >>directly conflict. Of course, one could go through JSON.php and >>rename everything - and do the same in all of the code that uses it, >>but this gets tedious fast. > > This argument (software has a bug, I need an alternative) is pointless. > The idea being to keep both extension and php script synced. Anyway, you > cannot be sure to have no bugs. > > Anyway, I made my point. > > --Pierre If the PEAR package and extension namespaces collide, this is a big problem. Uploading a plain text PHP file is often easier, and sometimes the only way for certain users to put files on their servers. If the JSON extension installed is buggy and already loaded, you wouldn't be able to load the PEAR package with simply json_encode()/json_decode() in it. The PEAR package should be able to use the extension, if present and so desired by the user. However, I do agree that the two should be interchangeable (provided difference are only bug-related) in their handling of input/output... -Philippe

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