最广泛启用的PHP cURL或https流包装器(openssl)

时间:2012-09-12 16:12:46

标签: php curl https openssl portability

我正在尝试编写可移植的php应用程序。我想要的是这个代码使用PHP> = 5.2

在尽可能多的共享主机提供商上工作

我需要此代码才能使用Dropbox API,因此需要https支持。据我了解,我有两个选项--cURL和来自openssl扩展的https流包装器。

我的问题是,您建议在大多数托管服务提供商上启用哪一个。

2 个答案:

答案 0 :(得分:1)

在PHP手册中查看this page,在PHP 4.0.2中添加了cURL个函数。“

因此,我认为你可以使用> = 5.2服务器。而且,cURL比PHP Stream功能更好。所以,坚持使用cURL!

答案 1 :(得分:1)

@stormbreaker

据我所知

Code Portability : Means writing your program (code) in such a way that the same code works on different environments. You should be easy to understand , identify exceptions and maintain

Widely Enabled : Means as Having great extent or range in availability by default or supported by majority of service providers

CURL支持同一lib中的更多功能,更清晰,多处理等。

https stream wrapper更广泛的可用性非常棘手,具体取决于您根据应用程序将表单平台移动到平台