Download the PHP package stil/curl-easy without Composer
On this page you can find all versions of the php package stil/curl-easy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stil/curl-easy
More information about stil/curl-easy
Files in stil/curl-easy
Package curl-easy
Short Description cURL wrapper for PHP. Supports parallel and non-blocking requests. For high speed crawling, see stil/curl-robot.
License MIT
Informations about the package curl-easy
Table of contents
- Introduction
- Description
- Main Features
- Installation
- Examples
- cURL\Request
- Request::__construct
- Request::getOptions
- Request::setOptions
- Request::getContent
- Request::getInfo
- Request::send
- cURL\RequestQueue
- RequestsQueue::__construct
- RequestsQueue::getDefaultOptions
- RequestsQueue::setDefaultOptions
- RequestsQueue::socketPerform
- RequestsQueue::socketSelect
- RequestsQueue::send
- cURL\Options
- Options::set
- Options::toArray
Introduction
Description
This is small but powerful and robust library which speeds the things up. If you are tired of using PHP cURL extension with its procedural interface, but you want also keep control about script execution - it's great choice for you! If you need high speed crawling in your project, you might be interested in stil/curl-easy extension - stil/curl-robot.
Main features
- widely unit tested.
- lightweight library with moderate level interface. It's not all-in-one library.
- parallel/asynchronous connections with very simple interface.
- attaching/detaching requests in parallel on run time!
- support for callbacks, so you can control execution process.
- intelligent setters as alternative to CURLOPT_* constants.
- if you know the cURL php extension, you don't have to learn things from beginning
Installation
In order to use cURL-PHP library you need to install the » libcurl package.
Install this library as Composer package with following command:
Examples
Single blocking request
The above example will output:
Single non-blocking request
The above example will output:
Requests in parallel
The above example will output:
Non-blocking requests in parallel
The above example will output something like that:
Processing queue of multiple requests while having maximum 2 at once executed at the moment
The above example will output something like that:
Intelligent Options setting
Replace CURLOPT_*
with set*()
and you will receive method name.
Examples:
Error handling
You can access cURL error codes in Response class. Examples:
Probably above example will output
You can find all of CURLE_* error codes here.