shapin / vimeo
This package is abandoned and no longer maintained.
No replacement package was suggested.
PHP client for Vimeo API
dev-master
2020-03-09 13:53 UTC
Requires
- php: ^7.3
- symfony/config: ^4.3|^5.0
- symfony/http-client: ^4.3|^5.0
- symfony/property-access: ^4.3|^5.0
- symfony/property-info: ^4.3|^5.0
- symfony/serializer: ^4.3|^5.0
Requires (Dev)
- phpunit/phpunit: ^8.5
- symfony/phpunit-bridge: ^4.4|^5.0
- symfony/var-dumper: ^4.3|^5.0
This package is auto-updated.
Last update: 2023-12-27 11:25:13 UTC
README
Install
Via Composer
composer require shapintv/vimeo
Usage
Create a VimeoClient
use Shapin\Vimeo\VimeoClient; use Symfony\Component\HttpClient\HttpClient; $httpClient = HttpClient::create([ 'base_uri' => 'https://api.vimeo.com/', 'auth_bearer' => self::VIMEO_TOKEN, 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/vnd.vimeo.*+json;version=3.4', ], ]); $client = new VimeoClient($httpClient);
Deal with videos
// Get a video $video = $client->videos()->get(362164795);
Integration with symfony
Create a new HttpClient:
framework: http_client: scoped_clients: vimeo.client: base_uri: 'https://api.vimeo.com/' auth_bearer: '%env(VIMEO_TOKEN)%' headers: 'Content-Type': 'application/json' 'Accept': 'application/vnd.vimeo.*+json;version=3.4'
Then create your service:
services: Shapin\Vimeo\VimeoClient: ['@vimeo.client', ~]
When do not use autowiring here in order to avoid the injection of the default Serializer
if you have one.
This SDK directly build its own Serializer
when none is passed which is fine for most use cases.
One day, I may consider creating a bundle in order to bootstrap this SDK...
License
The MIT License (MIT). Please see License File for more information.