Download the PHP package ares333/php-curl without Composer

On this page you can find all versions of the php package ares333/php-curl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-curl

中文文档

About

Implemented by using php-curl internal io event with high performance,high universality,high extensibility which especially suitable for massive tasks and complex logic cases.

Demand

PHP: >=5.3

Install

Features

  1. Extremely low cpu and memory consumption.
  2. All curl options are exposed directly which enables high universality and high extensibility.
  3. Api is very simple.
  4. Support process disruption and resume from last running state.
  5. Support dynamic tasks.
  6. Support transparent file cache.
  7. Support retry failed tasks automatically.
  8. Support global config,task config,callback config on same format and priority is from low to high.
  9. All configs can be changed on the fly and take effect immediately.

Work Flow

Curl::add() add tasks to task pool.Curl::start() start the event loop and block.Events(onSuccess,onFail,onInfo,onTask...) will be triggered and callbacks will be called on the fly.The loop finish when all tasks finished.

Tutorial

basic

file download

task callback

Task can be added in task callback. See more details in Curl::$onTask.

running info

Run in cli and will output with following format:

'onInfo' callback will receive all information.The default callback only show part of it.

transparent cache

Run the script second time and will output:

The result indicate that all tasks is using cache and there is no network activity.

dynamic tasks

Output is as below:

Finished url has '/' suffix because curl has processed the 3xx redirect automatically(Curl::$opt[CURLOPT_FOLLOWLOCATION]=true). Curl::onTask should be used to deal with massive tasks.

Curl (src/Curl.php Core functionality)

Max work parallels which can be change on the fly.

Max retry before onFail event is triggered.

Global CURLOPT_* which can be overwritten by task config.

Global cache config.Cache id is mapped from url.The config can be overwritten by task config and onSuccess callback return value with same format.

stack or queue.

Will be triggered when work parallels is less than Curl::$maxThread and task pool is empty.The callback parameter is current Curl instance.

Running state callback is triggered on IO events with max frequency 1/s.The parameters are as below:

  1. $info array with two keys 'all' and 'running'.Key 'running' contains response header(curl_getinfo()) for each running task.Key 'all' contains global information with keys as below:
    • $info['all']['downloadSpeed'] Download speed.
    • $info['all']['bodySize'] Body sized downloaded.
    • $info['all']['headerSize'] Header size downloaded.
    • $info['all']['activeNum'] Task has IO activity.
    • $info['all']['queueNum'] Tasks waiting for onSuccess.
    • $info['all']['finishNum'] Tasks has finished.
    • $info['all']['cacheNum'] Cache hits.
    • $info['all']['failNum'] Failed tasks number after retry.
    • $info['all']['taskNum'] Task number in the task pool.
    • $info['all']['taskRunningNum'] Running task number.
    • $info['all']['taskPoolNum'] Task pool number.
    • $info['all']['taskFailNum'] Retrying task number.
  2. Current Curl instance.
  3. Is last call or not.

Triggered on IO events.The callback parameter is current Curl instance.

Global callback for failed task which can be overwritten by task 'onTask'.The callback receive two parameters.

  1. array with keys as below:
    • errorCode CURLE_* constants.
    • errorMsg Error message.
    • info Response header.
    • curl Current Curl instance.
  2. $item['args'] value from Curl::add().

Add one task to the pool.

Return: current Curl instance.

Start the event loop and block.

Stop the event loop and return unprocessed tasks.

Parse http header and body from response.

Generate relative cache path.

Toolkit (src/Toolkit.php Necessary tools)

Default Curl instance is used if $curl is null.

The default instance will initialize Curl::$opt,Curl::onInfo,Curl::onFail. Curl::$opt initial values are as follows:

Default fail callback.See Curl::$onFail for details.

Default info callback.See Curl::onInfo for details.

The method can be triggered manually with a string parameter which will be added to output buffer.The purpose is to avoid interference of shell control characters.

Powerful html encoding transformer which can get current encoding automatically and replace html encoding value in \<head>\</head>. Parameters:

Return: New encoded html.

Full url or not.Return bool.

Replace space,process scheme and hosts and remove anchor etc.

Inverse function for parse_url().

Transform uri to full url for currentPage.$urlCurrent should be redirected after 3xx.

Transform full url to uri for currentPage.$urlCurrent should be redirected after 3xx.

Transform full url to dir.$urlCurrent should be redirected after 3xx.

Combine a base URL and a relative URL to produce a new absolute URL.

Filter out "." and ".." segments from a URL's path and return the result.

Return current Curl instance.


All versions of php-curl with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ares333/php-curl contains the following files

Loading the files please wait ....