Download the PHP package calabashdoll/curl-future without Composer

On this page you can find all versions of the php package calabashdoll/curl-future. 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 curl-future

CurlFuture: PHP Curl并行轮转请求库

multicurl系列方法是提高php请求后端http接口的一种途径。但是直接使用的话,存在几方面问题:

为了解决这些问题,开发了CurlFuture库,实现了并行请求,先到先取,链式执行的特性。

应用场景

对于一些大型公司,PHP作为接口聚合层来使用,而接口通过HTTP协议给出。对于一些复杂的页面,可能需要请求几十个相互独立的接口, 如果使用并行模式,则可以极大的提升性能。

安装方法

引入入口php文件即可:include __DIR__.'/curl_future.php';

使用方法

并行请求的实例(async.php)

链式执行的示例(then.php)

和Model/Service结合的示例(model.php)

原理

在每次fetch的时候,开始事件循环。当所需http返回后,结束循环。继续执行php逻辑。

性能测试

请求本机接口200次,nginx默认页面,同步、异步与file_get_contents对比

/example/bench.php

curl_future sync:384 ms
file_get_contents:390 ms
curl_futhre async:68 ms

curl_future sync:624 ms
file_get_contents:460 ms
curl_futhre async:69 ms

curl_future sync:463 ms
file_get_contents:355 ms
curl_futhre async:70 ms

curl_future sync:447 ms
file_get_contents:409 ms
curl_futhre async:66 ms

同步方式没有file_get_contents稳定,但是异步批量方式性能提升很明显。

参考项目


All versions of curl-future with dependencies

PHP Build Version
Package Version
No informations.
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 calabashdoll/curl-future contains the following files

Loading the files please wait ....