plotkabytes/redlink-api-php-client
Composer 安装命令:
composer require plotkabytes/redlink-api-php-client
包简介
Redlink API client for PHP
README 文档
README
We present simple RedlinkAPI v2.1 client for PHP.
This client is strongly based on GitLab PHP API Client.
Check out the:
Installation
This version supports PHP >= 7.2. To get started, simply require the project
using Composer. You will also need to install packages that "
provide" psr/http-client-implementation
and psr/http-factory-implementation.
Standard Installation
To install the client, you will need to be using Composer in your project. Here's how to install composer:
curl -sS https://getcomposer.org/installer | php
After getting composer you have to install two packages - this repository and PSR HTTP client implementation (for example Guzzle / Buzz):
$ composer require plotkabytes/redlink-api-php-client guzzlehttp/guzzle
This project is using following PSR's:
General library usage
Example script:
<?php // Use composer autoloader require __DIR__ . '/../vendor/autoload.php'; use Psr\Http\Message\ResponseInterface; use Plotkabytes\RedlinkApi\Utils\ResponseTransformer; // Create client $client = new \Redlink\DefaultClient(); // Setup authentication $client->setAuthentication("ENTER_API_KEY_HERE", "ENTER_APPLICATION_KEY_HERE"); // authentication v2 // Do something $response = $client->groups()->list(); // Optional, transform response to objects $responseTransformer = new ResponseTransformer(); /** * @var $parsedResponse RedlinkResponse */ $parsedResponse = $responseTransformer->createFromJson($response->getBody()); print_r($parsedResponse->getData()); print_r($parsedResponse->getErrors());; print_r($parsedResponse->getMeta());
If you are not sure how to use given method from this library then check our examples.
Details of API methods can be found on official documentation pages.
Using plugins
This library supports plugins.
The plugin system allows to wrap a Client and add some processing logic prior to and/or after sending the actual request.
Testing
$ docker-compose up -d
$ docker exec -it redlink-api-php-lib /bin/bash
$ composer install
$ php vendor/bin/phpstan analyze -c /var/www/html/phpstan.neon.dist
$ php vendor/bin/phpunit
$ php vendor/bin/psalm.phar
$ composer auto-format
Framework integration
Symfony support
Symfony support is provided by this package.
It supports Symfony >= 5.3 and PHP >= 7.2.
Laravel support
TODO
Versioning
We use Semantic Versioning 2.0.0.
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
Contributing
We will gladly receive issue reports and review and accept pull requests. Feel free to contribute in any way.
Author
Mateusz Żyła mateusz.zylaa@gmail.com
License
Redlink PHP API Client is licensed under The MIT License (MIT).
plotkabytes/redlink-api-php-client 适用场景与选型建议
plotkabytes/redlink-api-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.37k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 05 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「rest」 「api」 「library」 「email」 「sms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 plotkabytes/redlink-api-php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 plotkabytes/redlink-api-php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 plotkabytes/redlink-api-php-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
Alfabank REST API integration
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
BlockCypher's PHP SDK for REST API
Helper classes for creating cookie headers
统计信息
- 总下载量: 7.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-19