Manuel Lemos wrote:

Hello,

On 12/08/2003 11:06 PM, Justin Patrin wrote:

You may want to try this class that lets you make HTTP requests like a normal browser:

http://www.phpclasses.org/httpclient


Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/



> HTTP_Client


Why better? Have you tried both packages?




No, however, the httpclient system is a lot of code that is part of one


No? If you have not tried it at all WTF are you claiming that something else is better? Better than what? Something you have not tried?


Even if I have not used the other thing, I am still very likely to work with PEAR packages. Why? Because I know that I can get help with it from the PEAR developers and get fixes and updates easily and quickly.



class. HTTP_Client is based on lots of sub-systems, each of which can be used seperately and for other purposes (and each of which is maintained by seperate, multiple people). For instance, there is the Socket API,


Are you telling me that to make HTTP requests, loading half of dozen classes is better than doing it all with just one?


Yes, it is better to have them all in seperate packages for maintainability. If you have everything in one place, you're VERY prone to errors.


Now, I haven't seen the code for the phpclasses project, so I can't say anything about it, but in general having thing seperated is much better practice.


URL parsing, the HTTP Request, etc. All of which HTTP_Client is built upon instead of re-inventing.


AFAIK, this HTTP client class was released for the first time in 1999. The way I see it, if anybody reinvented anything, that must have been whoever came after that to do the same.


Ok, valid point.



Also, and just as important, using PEAR packages gives you a centralized way of dealing with errors.


You meant that 800 line fat base class that many PEAR classes inherit and require in order to run even when developers do not want anything from it?

No thanks, I am not interested in bloated software development.



PEAR is used in many production systems and the classes are tuned for speed. Or if they aren't you can alter them and send in a patch. PEAR promotes standards instead of ad-hoc programming. It's better to write your error handling code once instead of re-creating it for every package you ever write.


Not all PEAR packages inherit from PEAR. Some just use pieces of it. Some don't use it at all. It all depends on what the package needs.

--
paperCrane <Justin Patrin>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to