Is curl standard for hosts?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Envex
Forum Newbie
Posts: 13
Joined: Fri Sep 23, 2005 2:51 pm

Is curl standard for hosts?

Post by Envex »

Hey guys,

Quick question. Does anyone know is enabling curl with PHP is a standard in the web hosting industry? In other words, if I develop something that thousands will use on a wide variety of servers, is a curl requirement going to cause a headache for most people? Or do the majority of web hosts out there already have curl enabled, so they'll be able to install the software without any problem?

Assuming it'll be used on hundreds of different web hosts, should I make the software dependant on curl, or write my own code to take care of it?

Thanks alot,
Matt
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

always write a wrapper to external systems. Depending on your goals, I'd suggest you write your wrapper to work with cURL as well as fsockopen(), maybe even fopen()
Envex
Forum Newbie
Posts: 13
Joined: Fri Sep 23, 2005 2:51 pm

Post by Envex »

I'm sorry, but what would be the advantage of that? In that case, why wouldn't I just write the software to use only fsockopen() if basically every server with PHP supports it, instead of a wrapper that supports all three? I'm sure there's an advantage in doing so, but I can't see it. Any advice?

Thanks,
Matt
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

fsockopen() could be disabled, fopen() could be disabled.. the wrapper is there so you only have to write the interaction code once, but you can use it in many locations.. saves you from having to change many locations (and potentially adding odd bugs)..
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

I would think most hosts include curl because it's just a command-line http request. Very useful tool
Post Reply