📄 readme
字号:
CURL Extension Emulation LibraryVersion 1.0.4Copyright 2004-2007, Steve Blinchhttp://code.blitzaffe.com============================================================================DESCRIPTIONProvides a pure-PHP implementation of the PHP CURL extension, for use onsystems which do not already have the CURL extension installed. It emulatesall of the curl_* functions normally provided by the CURL extension itself.This will automatically detect and use the best CURL implementation availableon your server. It will attempt the following, in order:1) Check for the existence of the "real" CURL PHP Extension. If it isloaded, the library will do nothing (and it will not interfere with the"real" extension).2) Check for the existence of the CURL console binary (usually located in/usr/bin/curl). If found, the library will emulate the CURL PHPextension (including all curl_* functions) and use the console binaryto execute all requests.3) If neither the "real" CURL PHP Extension nor the CURL console binaryare available, the library will emulate the CURL PHP extension (includingall curl_* functions) using a native, pure-PHP HTTP client implementation.This implementation is somewhat limited, but it provides support for mostof the common CURL options. HTTPS (SSL) support is available in thismode under PHP 4.3.0 if the OpenSSL Extension is loaded.Thus, by including this library in your project, you can rely on having somelevel of CURL support regardless of the configuration of the server on whichit is being used.HISTORY1.0.4 (not released)- Fixed HTTPRetriever double-inclusion bug.USAGESimply copy all of the libcurlemu files into your project directory, then:require_once("libcurlemu.inc.php");After this, you can use all of the curl_* functions documented in the PHPManual.EXAMPLE// CURL Extension Emulation Library Example//// Usage should be straightforward; you simply use this script exactly as you// would normally use the PHP CURL extension functions.// first, include libcurlemu.inc.phprequire_once('libcurlemu.inc.php');// at this point, libcurlemu has detected the best available CURL solution// (either the CURL extension, if available, or the CURL commandline binary,// if available, or as a last resort, HTTPRetriever, our native-PHP HTTP// client implementation) and has implemented the curl_* functions if// necessary, so you can use CURL normally and safely assume that all CURL// functions are available.// the rest of this example code is copied straight from the PHP manual's// reference for the curl_init() function, and will work fine with libcurlemu// create a new CURL resource$ch = curl_init();// set URL and other appropriate optionscurl_setopt($ch, CURLOPT_URL, "http://www.example.com/");curl_setopt($ch, CURLOPT_HEADER, false);// grab URL and pass it to the browsercurl_exec($ch);// close CURL resource, and free up system resourcescurl_close($ch);LICENSEThis script is free software; you can redistribute it and/or modify it under theterms of the GNU General Public License as published by the Free SoftwareFoundation; either version 2 of the License, or (at your option) any laterversion.This script is distributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE. See the GNU General Public License for moredetails.You should have received a copy of the GNU General Public License alongwith this script; if not, write to the Free Software Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -