alexchitoraga/apiok
Composer 安装命令:
composer require alexchitoraga/apiok
包简介
APIOK PHP SDK with support for Laravel integration
README 文档
README
OK SDK PHP is a PHP wrapper providing an easier way to make API call using OKSDK REST methods.
Requirements
- PHP >= 5.4
Composer Installation
The best way to install Intervention Image is quickly and easily with Composer.
Now your composer.json has been updated automatically and you're able to require the just created vendor/autoload.php file to PSR-4 autoload the library.
The next step is to decide, if you want to integrate APIOK SDK into the Laravel framework. If you want to use the library with Laravel, just skip the following step and continue with the description of Laravel Integration.
Usage
APIOK SDK doesn't require Laravel or any other framework at all. If you want to use it as is, you just have to require the composer autoload file to instatiate image objects as shown in the following example.
// include composer autoload require 'vendor/autoload.php'; // import the Alexchitoraga APIOK Class use Alexchitoraga\Apiok\Apiok; // create an APIOK instance with custom app configs $apiok = new Apiok([ 'application_key' => '***', 'session_key' => '***', 'access_token' => '***', 'secret_key' => '***', ]); // Call OKSDK API method // Methods must be converted by next principle: // users.getInfo => usersGetInfo // messagesV2.sendGameInvite => messagev2SendGameInvite $apiok->usersGetInfo($params);
Integration in Laravel
APIOK has optional support for Laravel and comes with a Service Provider and Facades for easy integration. The vendor/autoload.php is included by Laravel, so you don't have to require or autoload manually. Just see the instructions below.
After you have installed APIOK, open your Laravel config file config/app.php and add the following lines.
In the $providers array add the service providers for this package.
Alexchitoraga\Apiok\ApiokServiceProvider::class
Add the facade of this package to the $aliases array.
'Apiok' => Alexchitoraga\Apiok\Facades\Apiok::class
Now the Apiok Class will be auto-loaded by Laravel.
Configuration
APIOK hasn't default configurations as each OK application has it's own configuration. To set configuration you have to add new service in config/services.php file.
'apiok' => { 'application_key' => env('APPLICATION_KEY'), 'session_key' => env('SESSION_KEY'), 'access_token' => env('ACCESS_TOKEN'), 'secret_key' => env('SECRET_KEY'), ],
Testing
Tests are stored in /tests folder. There are two tests which are disabled. To run them you must modify phpunit.xml php constansts by configuration from your applications. Also you must to prefix this two tests with keyword "test".
alexchitoraga/apiok 适用场景与选型建议
alexchitoraga/apiok 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「test」 「sdk」 「laravel」 「OK」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alexchitoraga/apiok 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alexchitoraga/apiok 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alexchitoraga/apiok 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
A PSR-7 compatible library for making CRUD API endpoints
Specification-oriented BDD helpers for PHPUnit
KissTest is command-line free, fast, simple and beautiful unit test framework.
PWWEB Artomator
Alfabank REST API integration
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-26