esi/librariesio
Composer 安装命令:
composer require esi/librariesio
包简介
LibrariesIO - A simple API wrapper/client for the Libraries.io API.
README 文档
README
2.0.0 Important Note
- The
masterbranch 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.
Important Note
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.
Installation
Composer
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.
Basic Usage
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.
Documentation
The docs/ folder or online here.
About
Requirements
- 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.
Credits
Contributing
See CONTRIBUTING.
Bugs and feature requests are tracked on GitHub.
Contributor Covenant Code of Conduct
Backward Compatibility Promise
See backward-compatibility.md for more information on Backwards Compatibility.
Changelog
See the CHANGELOG for more information on what has changed recently.
License
See the LICENSE for more information on the license that applies to this project.
Security
See SECURITY for more information on the security disclosure process.
esi/librariesio 适用场景与选型建议
esi/librariesio 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 12 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「libraries」 「API-Client」 「api-wrapper」 「libraries.io」 「librariesio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 esi/librariesio 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 esi/librariesio 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 esi/librariesio 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Custom libraries for CakePHP framework
O2System PSR it's build based on PHP Framework Interop Group (PHP-FIG) standards recommendations. This repository contains a collection of PHP interfaces based on the PSR-0 until the PSR-7.
Meta-package of Tatter modules for CodeIgniter 4
Skolkovo API Client
A PSR-7 compatible library for making CRUD API endpoints
PHP Cache Handler Library
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-25