A PHP library to access the API of the Rokka image service.
If you are using the Symfony framework, have a look at the Rokka Symfony Bundle which integrates this library into Symfony.
Require the library using composer:
composer require rokka/client
The Rokka\Client\Factory
is the entry point for creating the API client.
You will need to register for a Rokka account and use the api key you receive.
The user client is used for user and organization management.
use Rokka\Client\Factory;
$apiKey = 'myKey';
$userClient = Factory::getUserClient();
$userClient->setCredentials($apiKey);
There is an optional parameter to specify the base URL of the Rokka API. This usually does not need to be adjusted.
The image client is used to upload images into an organization and manage output stacks.
use Rokka\Client\Factory;
$organization = 'testorganization';
$apiKey = 'myKey';
$imageClient = Factory::getImageClient($organization, $apiKey);
There is an optional fourth parameter to specify the base URL of the Rokka API. This usually does not need to be adjusted.
See the official documentation on how to use the Rokka API.
See als the API Docs for further information.
Run vendor/bin/phpunit
in the project root.
curl http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar > /tmp/php-cs-fixer.phar
php /tmp/php-cs-fixer.phar fix -v --diff --using-cache=yes src/