Re: Re: Packages accessing super globals

From: Date: Wed, 18 May 2005 22:57:54 +0000
Subject: Re: Re: Packages accessing super globals
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37739@lists.php.net to get a copy of this message
The one advantage of such a setup that I can see is that PEAR could do some sanitization of the $_GET/$_POST variables before you start working on them. That being said it's a "nice thing to have" not a "OMG! You're using $_GET directly?!?!?111" thing, IMO. I would think a separate package (HTTP_Request_Sanitize?) would make more sense than shoving it where it don't belong (in PEAR's base classes). That way authors can use $_GET/$_POST directly (why a low level PEAR package would ever need that is beyond me - I guess Auth would though) or they can use the package. --Joe On May 18, 2005, at 2:19 PM, Vincent Lascaux wrote:
I think that PEAR should provide a central system to abstract these calls, so all packages would do something like PEAR::getGet('action'); PEAR::getPost('username');
Could you clarify the benefits of such a thing? I think it obfuscates the code and could make it slower to execute. I understand that one of the benefit would be to allow people to override PEAR::get... and PEAR::set... functions, but then you will probably want to override for one package and not for another one, making the design even more complex, and slowing down even more the execution of the script. I think that if such a functionality is needed by a package, it should be implemented by the package itself (but again, I probably haven't thought about all the application of these functions) --Vincent --PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Joseph C. Stump joe@joestump.net http://www.joestump.net

Attachment: [application/pkcs7-signature] smime.p7s
« previous php.pear.dev (#37739) next »