poster/api
Composer 安装命令:
composer require poster/api
包简介
PHP library which makes Poster API using smooth as glass
README 文档
README
PHP library which makes Poster API using smooth as glass.
You can use suggestions to api methods names and don`t have to worry about request type.
Just navigate through API sections like settings or menu.
Installation
composer require poster/api
Example of making API calls
It's convenient to use singleton class PosterApi.
All you need to is initialize class with user credentials and then you can call Poster API methods anywhere in your project
<?php use poster\src\PosterApi; // Setting up account and token for requests PosterApi::init([ 'account_name' => 'demo', 'access_token' => '4164553abf6a031302898da7800b59fb', ]); // Reading settings $result = (object)PosterApi::settings()->getAllSettings(); var_dump($result); // Setting up extras for account $result = (object)PosterApi::application()->setEntityExtras([ 'entity_type' => 'settings', 'extras' => [ 'synced' => true ] ]); var_dump($result);
Example of OAuth
- Generate url and redirect user to it to start oAuth
<?php use poster\src\PosterApi; PosterApi::init([ 'application_id' => 1, // Your application id (client_id) 'application_secret' => '1362900b6c441dd0f219bd0974c7e2b8', // secret 'redirect_uri' => 'http://example.com/poster/auth', ]); $oAuthUrl = PosterApi::auth()->getOauthUrl(); // Redirect user to this url to start authorization http_redirect($oAuthUrl);
- Catch user redirect to the
redirect_uriwhich you used in previous step and get access token
<?php use poster\src\PosterApi; $result = (object)PosterApi::auth()->getOauthToken($_GET['account'], $_GET['code']); if (empty($result->access_token)) { echo "Poster auth error"; var_dump($result); die; } // In case of successful auth, token and account name would be placed into config automatically $settings = PosterApi::settings()->getAllSettings(); var_dump($settings);
poster/api 适用场景与选型建议
poster/api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.05k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2018 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「poster」 「joinposter」 「Poster API」 「Poster Library」 「Poster PHP API」 「Poster API Binding」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 poster/api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 poster/api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 poster/api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
poster generator. 基于GD库的PHP海报生成器,返回base64
PHP captcha (click/rotate/slider) and poster generation — framework-agnostic with adapters for Laravel, ThinkPHP, Webman, Hyperf.
Баннерная сеть
Image synthesis, image processing, personal poster image and sharing image generation。生成海报图、水印、调整图片大小、图片中插入文字等等
A make poster package
统计信息
- 总下载量: 10.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-01