dms/meetup-api-bundle
Composer 安装命令:
composer require dms/meetup-api-bundle
包简介
DMS Meetup API Bundle, enables Meetup API clients in services
README 文档
README
This bundle leverages Meetup API Client distributed in rdohms/meetup-api-client. It provides instances of clients to manipulate the Meetup.com API.
This bundle is part of the DMS Library, and distributed as a sub-directory split, issues should be reported at the DMS Repository.
Installing
Add extension to your composer file:
{
"require": {
"dms/meetup-api-bundle": "~1.*"
}
}
or use composer's require command
composer require dms/meetup-api-bundle:~1.*
Load the bundle in your AppKernel
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new DMS\Bundle\MeetupApiBundle\DMSMeetupApiBundle(),
);
}
Usage
Each version of the client needs different configuration, but they can be used side-by-side
Key Auth Client
This client uses a simple signing based on a API key, configuring it is just a matter for defining the key.
dms_meetup_api:
client:
key: <api-key>
OAuth Client
The OAuth client requires a bit more information to run. It has two parts, the consumer key and secret which can be set via config:
dms_meetup_api:
client:
consumer_key: <key>
consumer_secret: <secret>
But it also needs a valid token and token secret, these must be obtained via a hand shake. You can use the built-in handshake, or do it yourself. Once tokens are retrieved they must be set into the session using the setSessionTokens($token, $tokenSecret) method.
The client will then use these to sign future requests.
OAuth Handshake
This bundle also has a built-in controller for performing the OAuth 1.0a handshake with the Meetup.com API. It will request the proper tokens, and store the access tokens in the session for use during that session.
Once the handshake is done it will look for a route named meetup_redirect_url if this is defined it will redirect to that page, otherwise to the index page.
To start the process redirect the user to the meetup-oauth-authorize route. It will get request tokens, redirect the user to the authorization url and then get proper access tokens if authorized.
Injecting into other services
In order to inject the API clients (Key and OAuth) into other services there are two services defined that make use of Symfony's factory method options in the service definitions. These use the available factory methods to define new services easily usable in other services, they are:
dms_meetup_api.key_clientdms_meetup_api.oauth_client
dms/meetup-api-bundle 适用场景与选型建议
dms/meetup-api-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.47k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2013 年 03 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「api」 「bundle」 「dms」 「meetup」 「meetup.com」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dms/meetup-api-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dms/meetup-api-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dms/meetup-api-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
Provide a way to secure accesses to all routes of an symfony application.
A PSR-7 compatible library for making CRUD API endpoints
Bundle Symfony DaplosBundle
Provides a Data Grid tables for your Symfony project.
统计信息
- 总下载量: 6.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-03-24