Fast Curl
Package:
Summary:
Send HTTP requests using Curl extension
Groups:
Author:
Description:
This package can be used to send HTTP requests using Curl extension.
There are two classes: one for sending regular HTTP requests and another to send multiple parallel requests.
Both classes can send HTTP requests directly or via proxy, securely using SSL or not, setting the referrer URL, cookies, custom headers, etc...
Constructor will initialize curl handle with most common values althought you can set custom values like url, referrer, proxy, exec_mode, cookies, custom_headers, timeout and ssl. (By default you can use HTTP/HTTPS with need of caring about keys, certs, etc...)
Apart from constructor, EVERY CURLOPT can be set with a simple assignment instead of using curl_setopt() or any "obscure" method.
For instance:
$fc->url = 'http://phpclasses.org';
and retrieved like this:
$url = $fc->url;
There are two methods to execute requests:
exec(...) -> It returns a FRESH response.
fetch(...) -> It returns LAST response. (You can use a regex pattern to parse response).
FastCurlMulti is a container of FastCurl objects. Use it to make parallel requests.
For instance:
$fcm = new FastCurlMulti();
$fcm->add($fc1);
$fcm->add($fc2);
$fcm->exec();
Destructors will free any thing that has to be free. Do not worry.
DOC HERE -> http://tonikelope.es/fastcurl/doc/
DOWNLOAD HERE -> http://tonikelope.es/fastcurl/
There are two classes: one for sending regular HTTP requests and another to send multiple parallel requests.
Both classes can send HTTP requests directly or via proxy, securely using SSL or not, setting the referrer URL, cookies, custom headers, etc...
Constructor will initialize curl handle with most common values althought you can set custom values like url, referrer, proxy, exec_mode, cookies, custom_headers, timeout and ssl. (By default you can use HTTP/HTTPS with need of caring about keys, certs, etc...)
Apart from constructor, EVERY CURLOPT can be set with a simple assignment instead of using curl_setopt() or any "obscure" method.
For instance:
$fc->url = 'http://phpclasses.org';
and retrieved like this:
$url = $fc->url;
There are two methods to execute requests:
exec(...) -> It returns a FRESH response.
fetch(...) -> It returns LAST response. (You can use a regex pattern to parse response).
FastCurlMulti is a container of FastCurl objects. Use it to make parallel requests.
For instance:
$fcm = new FastCurlMulti();
$fcm->add($fc1);
$fcm->add($fc2);
$fcm->exec();
Destructors will free any thing that has to be free. Do not worry.
DOC HERE -> http://tonikelope.es/fastcurl/doc/
DOWNLOAD HERE -> http://tonikelope.es/fastcurl/
Comments are closed.