Simple async access to packagist.org's API, like listing project details, number of downloads, etc.
This is an async version of KnpLab's excellent packagist-api
,
but built upon React PHP's non-blocking event-loop
.
It uses the async HTTP client library buzz-react
to process
any number of requests in parallel.
In a nutshell, it allows you to issue multiple requests to the packagist API in parallel and process them out of order
whenever their results arrive - while trying to hide all the nifty details of async processing.
On top of that it provides a very easy to use API, very much similar to the original packagist-api
,
enriched with the comfort of React PHP's Promises/A.
Note: This project is in beta stage! Feel free to report any issues you encounter.
Once installed, you can use the following code to fetch package information from packagist.org:
$client = new Client($browser);
$client->get('clue/phar-composer')->then(function (Package $package) {
var_dump($package->getName(), $package->getDescription());
});
The recommended way to install this library is through composer. New to composer?
{
"require": {
"clue/packagist-api-react": "~0.1.0"
}
}
MIT