定制 rokka/client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rokka/client

最新稳定版本:1.21.2

Composer 安装命令:

composer require rokka/client

包简介

Rokka.io client library

README 文档

README

Build Status Static analysis 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.

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::getUserClientorFactory::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 

统计信息

  • 总下载量: 316.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 5
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固