A Vimeo Api Service Provider for Silex
, (*1)
Service Provider that integrates Vimeo's official PHP API libary to Silex, (*2)
Install
Via Composer, (*3)
``` bash
$ composer require ivoba/vimeo-api-service-provider, (*4)
## Usage
Register the Provider:
``` php
$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., (*5)
To show your token, call this once in your app, in debug mode. It will throw an exception that will show your token., (*6)
``` php
$app['vimeo.api.show_token'];, (*7)
Now you can use the Vimeo API with:
``` php
$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., (*8)
- authenticated mode
- token storage interface
- set & get token from storage if set
Testing
bash
$ vendor/bin/phpunit
, (*9)
Contributing
Please see CONTRIBUTING for details., (*10)
License
The MIT License (MIT). Please see License File for more information., (*11)