ivoba/vimeo-api-service-provider
最新稳定版本:1.0.0
Composer 安装命令:
composer require ivoba/vimeo-api-service-provider
包简介
A Vimeo Api ServiceProvider for Silex.
README 文档
README
Service Provider that integrates Vimeo's official PHP API libary to Silex
Install
Via Composer
$ composer require ivoba/vimeo-api-service-provider
Usage
Register the Provider:
$app->register(new Ivoba\Silex\VimeoApiServiceProvider(), array('vimeo.options' => array('client_key' => 'key', 'client_secret' => 'secret', 'access_token' => 'your_token')));
Default modus is unauthenticated.
It is recommended that you generated the access token once, store it to your config and use it forever.
If you dont provide a token, your token will be retrieved from Vimeo for every call, which will cost performance.
To show your token, call this once in your app, in debug mode. It will throw an exception that will show your token.
$app['vimeo.api.show_token'];
Now you can use the Vimeo API with:
$app['vimeo.api']->request('/videos', array('query' => 'silex', 'format' => 'php', 'full_response' => '1', 'per_page' => 8, 'sort' => 'date'), 'GET');
Todo
I did not use authenticated mode yet, so this Provider doesnt have any helpers for it.
Feel free to provide some.
- authenticated mode
- token storage interface
- set & get token from storage if set
Testing
$ vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-16