rokka / client
Rokka.io client library
Installs: 269 465
Dependents: 6
Suggesters: 0
Security: 0
Stars: 7
Watchers: 6
Forks: 6
Open Issues: 3
Requires
- php: ^8.0
- ext-json: *
- firebase/php-jwt: ^6.0
- guzzlehttp/guzzle: ^6.5.8|^7.4.5
- guzzlehttp/psr7: ^1.9.1|^2.4.5
- jbroadway/urlify: ^1.2
- rokka/utils: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4
- phpstan/phpstan: ^1.7
- phpunit/phpunit: ^9.5.25
- symfony/var-dumper: ^3.4|^4.0|^5.0|^6.0
- dev-master / 1.x-dev
- 1.21.1
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.2
- 1.18.1
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.1
- 1.15.0
- 1.14.0
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.1
- 1.12.0
- 1.11.1
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.0
- 0.2.1
- 0.2.0
- dev-fix-doc-deployment
- dev-php-7.1
- dev-async
- dev-old/tmp-multiarea-templatehelper
- dev-old/templatehelper-for-reference-2
- dev-old/templatehelper-for-reference
- dev-old/templatehelper-before-rebase
- dev-old/multiple-operations-and-more
- dev-old/templatehelper-from-multiple-operations
This package is auto-updated.
Last update: 2024-12-05 12:19:16 UTC
README
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.
About
rokka is digital image processing done right. Store, render and deliver images. Easy and blazingly fast. This library allows to upload and manage your image files to rokka and deliver them in the right format, as light and as fast as possible. And you only pay what you use, no upfront and fixed costs.
Free account plans are available. Just install the plugin, register and use it.
Installation
Require the library using composer:
composer require rokka/client
Bootstrapping
You will need to register for a Rokka.io account and use the API key you receive. The recommended way to do so is by using the rokka-cli.
The Rokka\Client\Factory
is the entry point for creating the API client.
You then need to set the credentials you created with the cli command.
User Client
The user client is used for user and organization management.
use Rokka\Client\Factory; $apiKey = 'myKey'; $userClient = Factory::getUserClient($organization = null, $apiKey =null, $options = []); $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 rendering stacks.
use Rokka\Client\Factory; $organization = 'testorganization'; $apiKey = 'myKey'; $imageClient = Factory::getImageClient($organization, $apiKey);
There is an optional parameter to specify the base URL of the Rokka API. This usually does not need to be adjusted.
Options for clients
You can add an options array as last parameter to Factory::getUserClientor
Factory::getImageClient`.
It takes the following format:
[ Factory::API_BASE_URL => 'https://some-other-api.rokka.io', Factory::RENDER_BASE_URL => 'https://myimages.example.com', // you you want/have another render base url Factory::PROXY => 'http://proxy:8888', // if you need to use a proxy Factory::GUZZLE_OPTIONS => ['verify' => false] // any guzzle option you need/want ]
Usage
Read the Getting Started guide of the rokka.io documentation to learn about the basic concepts of rokka.
The image and user clients provide the operations described in the API Reference section of the rokka documentation.
See als the API Docs for further information.
Running tests
Run vendor/bin/phpunit
in the project root.
Running PHP-CS-Fixer
composer run lint:fix
Running phpstan
composer run phpstan