hounddog / hd-instagram
Instagram API 的 ZF2 模块。
dev-master
2014-06-19 11:54 UTC
Requires
- php: >=5.4
- hounddog/hd-api-client: dev-master
Requires (Dev)
- phpunit/phpunit: 3.7.*
- squizlabs/php_codesniffer: 1.4.*
This package is not auto-updated.
Last update: 2024-09-10 02:10:52 UTC
README
版本 0.0.1 由 Martin Shwalbe 创建
简介
HdClientApi 是基于 Zend Framework 2 的各种基于 API 的模块(例如 Github、Twitter、Instagram 等)的连接器。
安装
主要设置
- 将此项目克隆到您的
./vendor/
目录中,并在您的application.config.php
文件中启用它。
使用方法
基本使用
以下是一个简短的示例,说明如何使用
$client = $serviceManager->get('EdpGithub\Client');
$repos = $client->api('user')->repos('hounddog');
这将获取用户 Hounddog 的所有仓库
身份验证
要使用需要身份验证的功能,您必须首先进行身份验证
$client = $serviceManager->get('EdpGithub\Client');
$client->authenticate('url_token', 'access_token');
$repos = $client->api('current_user')->repos();
您还可以监听事件 'EdpGithub\Client', 'api'
$em->attach('EdpGithub\Client', 'api', function($e) use ($sm) {
$client = $e->getTarget();
$client->authenticate('url_token', $token /* your access_token here */);
} );
文档
请参阅 Wiki 以获取更详细的文档