- The
master
branch is for development of the upcoming version 2.0.0.- This is a notable exception to the backward compatibility promise, as most of this work was done before it was implemented.
- Should be relatively stable, but would still advise against using in production.
- Function parameters, class api's, etc. may change during development.
- The docs have not yet been fully updated with changes.
This project was born from the desire to expand my knowledge of API's and GuzzleHttp. My implementation is far from perfect, so I am open to any and all feedback that one may wish to provide.
- The Libraries.io API has the ability for pagination, however it is not yet fully implemented in this library.
Install the latest version with:
$ composer require esi/librariesio
Then, within your project (if not already included), include composer's autoload. For example:
<?php
require 'vendor/autoload.php';
?>
For more information see the installation docs.
LibrariesIO splits the different endpoints based on their "component":
- Esi\LibrariesIO\LibrariesIO::platform()
- does not require an $endpoint, though you can pass 'platforms'.
- Esi\LibrariesIO\LibrariesIO::project()
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Current endpoints are:
- contributors
- dependencies
- dependents
- dependent_repositories
- project
- search
- sourceRank
- Current endpoints are:
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Esi\LibrariesIO\LibrariesIO::repository()
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Current endpoints are:
- dependencies
- projects
- repository
- Current endpoints are:
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Esi\LibrariesIO\LibrariesIO::user()
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Current endpoints are:
- dependencies
- packages
- package_contributions
- repositories
- repository_contributions
- subscriptions
- user
- Current endpoints are:
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Esi\LibrariesIO\LibrariesIO::subscription()
- takes an 'endpoint' parameter to specify which subset you are looking for.
- Current endpoints are:
- subscribe
- check
- update
- unsubscribe
- Current endpoints are:
- takes an 'endpoint' parameter to specify which subset you are looking for.
Each 'subset' has their own required options. Check the documentation (currently WIP) for more information.
As an example, let's say you want to get a list of the available platforms. To do so:
<?php
use Esi\LibrariesIO\LibrariesIO;
use Esi\LibrariesIO\Utils;
$api = new LibrariesIO('..yourapikey..', \sys_get_temp_dir());
$response = $api->platform();
print_r(Utils::toArray($response));
/*
Array
(
[0] => Array
(
[name] => NPM
[project_count] => 4079049
[homepage] => https://www.npmjs.com
[color] => #f1e05a
[default_language] => JavaScript
)
[1] => Array
(
[name] => Maven
[project_count] => 588275
[homepage] => http://maven.org
[color] => #b07219
[default_language] => Java
)
[...]
)
*/
?>
For more information see the basic usage docs.
The docs/
folder or online here.
- LibrariesIO works with PHP 8.2.0 or above.
- All API requests include an api_key parameter. You will need to get your api key from your account page at libraries.io.
- Eric Sizemore
- All Contributors
- Special thanks to JetBrains for their Licenses for Open Source Development
See CONTRIBUTING.
Bugs and feature requests are tracked on GitHub.
See backward-compatibility.md for more information on Backwards Compatibility.
See the CHANGELOG for more information on what has changed recently.
See the LICENSE for more information on the license that applies to this project.
See SECURITY for more information on the security disclosure process.