rokka/client
Composer 安装命令:
composer require rokka/client
包简介
Rokka.io client library
README 文档
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::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
Running PHP compatibility check
composer run phpcompatibility
rokka/client 适用场景与选型建议
rokka/client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 344.28k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2016 年 03 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「images」 「resize」 「optimization」 「cdn」 「transcoding」 「processing」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rokka/client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rokka/client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rokka/client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
A Laravel Nova field for distribute your images as array of object.
Pexels API Client for www.pexels.com
Image optimization widget for Yii2 Framework with auto WebP/AVIF image format generation from PNG/JPG files.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
Optimize your email templates' styles via native Laravel templating mechanism.
统计信息
- 总下载量: 344.28k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 19
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-18