我正在尝试编写可移植的php应用程序。我想要的是这个代码能够在尽可能多的共享主机提供商上使用PHP>= 5.2
我需要此代码与Dropbox API的操作,所以https支持是必要的。据我所知,我有两个选择-- cURL和openssl扩展中的https stream包装器。
我的问题是,你会推荐哪一个在大多数主机提供商上启用。
发布于 2012-09-12 16:45:58
@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在相同的库中支持更多的功能,更干净,多进程等。
https stream wrapper
的可用范围更广,这取决于您根据应用程序从一个平台移动到另一个平台时会非常棘手
发布于 2012-09-12 16:17:26
查看PHP手册中的this page,cURL
函数是“在PHP4.0.2中”添加的。
因此,我认为您可以使用>=5.2服务器。此外,cURL比PHP Stream函数要好得多。所以,继续使用cURL吧!
https://stackoverflow.com/questions/12392397
复制相似问题