libcurl Emulator
Ensures that your CURL-enabled script works anywhere
GZipped Archive
Download (27KB)
Provides a pure-PHP implementation of the PHP CURL extension, for use on systems which do not already have the CURL extension installed. It emulates all of the curl_* functions normally provided by the CURL extension itself.
This will automatically detect and use the best CURL implementation available on your server. It will attempt the following, in order:
- Extension: Check for the existence of the "real" CURL PHP Extension. If it is loaded, the library will do nothing (and it will not interfere with the "real" extension).
- Commandline: Check for the existence of the CURL commandline binary (usually located in /usr/bin/curl). If found, the library will emulate the CURL PHP extension (including all curl_* functions) using the commandline binary to execute all HTTP requests.
- Native: If neither the "real" CURL PHP Extension nor the CURL commandline binary are available, the library will emulate the CURL PHP extension (including all curl_* functions) using a native, pure-PHP HTTP client implementation (HTTPRetriever) which provides support for almost all CURL options. HTTPS (SSL) support is available in this mode under PHP 4.3.0 if the OpenSSL Extension is loaded.
Thus, by including this library in your project, you can rely on having some level of CURL support regardless of the configuration of the server on which it is being used.