pbxg33k / vocadb
PHP API client for the VocaDB Public API (v1)
Installs: 1 648
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- guzzlehttp/guzzle: ~5.0|~6.0
Requires (Dev)
- pbxg33k/pbxg33k-traits: dev-master
- phpunit/phpunit: 4.8.*@dev
- symfony/console: ^3.0
- symfony/var-dumper: ^3.0
This package is auto-updated.
Last update: 2024-10-08 07:16:45 UTC
README
VocaDB API PHP Client
NOTE: This is an early alpha release which is still in development!
Installation
Using composer (recommended)
Simply run: composer require pbxg33k/vocadb dev-master
or add the following line to your require in composer.json:
"pbxg33k/vocadb":"dev-master"
Without composer
- Download this repository as a zip file.
- Extract to a directory in your application
- Add files to your project
- Map "pbxg33k/vocadb" to this directory if your autoloader is PSR-4 compatible
- Include
autoload.php
to your project if either you don't have an autoloader or your autoloader is not PSR-4 compatible
How to use
The goal of this project is an easy integration with VocaDB's public API.
Before you can do anything you must load the client
$client = new Pbxg33k\VocaDB\Client();
The client uses Guzzle to communicate with the API. You can pass any guzzle configuration in an array mapped to the 'guzzle' key.
Let's say for example your server is behind a proxy and cannot communicate directly with VocaDB's API. We can instruct Guzzle to use a proxy for communication by simply adding the proxy information to the constuctor.
$guzzleConfig = [ 'request.options' => [ 'proxy' => 'tcp://localhost:80/' ] ]; // We assign the $guzzleConfig to array('guzzle' => data) so we don't mix up the library's own config. $clientConfig = ['guzzle' => $guzzleConfig]; $client = new Pbxg33k\VocaDB\Client($clientConfig);
From this point on you can communicate with the API by simply calling the client's methods.
// Get Livetune's information $livetune = $client->artist->getByName('livetune'); // $livetune is now an array with searchresults
TODO
- Add all missing endpoints
PARTIALLY DONE
Song- Entry
- SongList
PARTIALLY DONE
Album- User
PARTIALLY DONE
TagPARTIALLY DONE
ArtistPARTIALLY DONE
ReleaseEvent- Discussion