The official PHP client library for Rokka.io
PHP Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts build sami docs for all 1.x branches Feb 19, 2018
src
tests
.gitattributes Added php-cs-fixer settings (closes #22) Apr 9, 2018
.gitignore Added php-cs-fixer settings (closes #22) Apr 9, 2018
.php_cs.dist
.styleci.yml configure styleci Feb 27, 2017
.travis.yml phpstan 0.10.1 has some new tricks Jul 5, 2018
CHANGELOG.md Prepare 1.4.0 release Aug 15, 2018
LICENSE
README.md Added php-cs-fixer settings (closes #22) Apr 9, 2018
composer.json add uploadSourceImageByUrl Aug 14, 2018
phpstan.neon
phpunit.xml.dist Version 0.2.0 cleaned up commit Mar 18, 2016

README.md

Rokka PHP Client

Build Status StyleCI Latest Stable Version

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.

Installation

Require the library using composer:

composer require rokka/client

Bootstrapping

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.

User Client

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.

Image Client

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.

Usage

See the official documentation on how to use the Rokka API.

API Docs

See als the API Docs for further information.

Running tests

Run vendor/bin/phpunit in the project root.

Running PHP-CS-Fixer

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/