ivoba / vimeo-api-service-provider
A Vimeo Api ServiceProvider for Silex.
Requires
- php: >=5.3.0
- silex/silex: ~1.0
- vimeo/vimeo-api: 1.1.*
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is auto-updated.
Last update: 2024-11-10 21:44:14 UTC
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.