Re: Re: [ANNOUNCEMENT] Contact_Vcard_Parse-1.30 (stable) Released.

From: Date: Wed, 18 Feb 2004 23:47:13 +0000
Subject: Re: Re: [ANNOUNCEMENT] Contact_Vcard_Parse-1.30 (stable) Released.
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25707@lists.php.net to get a copy of this message
On Feb 18, 2004, at 4:36 PM, Lukas Smith wrote:
Paul M Jones wrote:
Hi,
the better approach would have been to do something like this: if(!function_exists("file_get_contents")) {
    function file_get_contents($filename, $use_include_path = 0)
...
I thought of that, but I am paranoid about polluting the global function space.
...
Thus, I think the method used in Contact_Vcard_Parse is safer when combined with an unknown code base (which the end-user code base certainly is) ... but that's just me.
Yeah I guess you could argue that way. I still dont quite agree, since the chance for a collision is very rare and you penalize all the 4.3 users for those rare cases.
Quite right; it is certain to be rare. Perhaps my sensibilities are too finely tuned. I think given the nature of the class, the penalty for most 4.3 users is negligible to nonexistent. There is a middle way that I just thought of: the fromFile() method itself can check to see if function_exists('file_get_contents'): if so, then use it; if not, use the internal method. Both spheres are then at peace. :-) I can implement easily that if anyone really cares. -- Paul M. Jones pmjones@ciaweb.net Savant: the simple alternative to Smarty. http://phpsavant.com/

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