rokka/client-bundle
Composer 安装命令:
composer require rokka/client-bundle
包简介
Defines services for accessing the Rokka image service in the symfony framework
README 文档
README
A Symfony bundle for the Rokka image service.
rokka is digital image processing done right. Store, render and deliver images. Easy and blazingly fast. This bundle 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
The rokka Symfony bundle comes with a flex recipe.
Do the following.
composer config extra.symfony.allow-contrib true
composer require rokka/client-bundle
Then you can add your api key and organization to the .env file
or edit config/packages/rokka.yaml.
Configuration
Enter your api key and organization strings.
rokka_client:
api_key: 'key-here'
organization: 'my-organization'
# Optional, not needed for most users
#base_url: https://api.rokka.io
base_url is to override the API location. We use this for testing mainly, so no need to change it ever.
Usage
The bundle will create two services for you, rokka.client.image and rokka.client.user. These give you access to the
basic functionality from the rokka/client library, pre-configured with
your credentials.
This bundle also provides console commands to interact with rokka.io. If you only want a CLI for rokka, you can also install the rokka PHP CLI tool as stand-alone phar.
See the official documentation for further information on how to use rokka.
Twig
The rokka twig extension is automatically included. It provides a couple of twig filters and functions to build rokka image URLs in twig templates. Some filters even allow to upload images on the fly:
{{ '/path/to/image' | rokka_stack_url('preview', seo='my-seo-image-url-fragment', seoLanguage = 'fr') }}
{{ rokka_generate_url(my_rokka_hash, 'preview', seo='my-image-url-fragement') }}
The README of the rokka twig package documents how to use the filters.
Image paths are by default assumed to be relative to the public directory of the Symfony application. You can
configure a different image root path with:
rokka_client:
web_path_resolver:
root_dir: "%kernel.project_dir%/path/to/images"
See the README of the rokka twig package for further customization options. To use those options, you will need to overwrite services of this bundle.
Moving from LiipImagineBundle
If you use imagine and want to switch to rokka, create a rokka stack for each imagine filter you have.
And then replace imagine_filter with rokka_stack_url in your twig templates (maybe also state the format, if you don't want jpg).
If your images are not stored on the file system, then you need to do some further adjustments. The twig extension readme explains how to load images from other sources.
rokka/client-bundle 适用场景与选型建议
rokka/client-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 135.79k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2016 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「image」 「images」 「symfony-bundle」 「rokka」 「rokka.io」 「imagemanipulation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rokka/client-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rokka/client-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rokka/client-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova field for distribute your images as array of object.
Pexels API Client for www.pexels.com
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
Symfony bundle for the Rekapager library
统计信息
- 总下载量: 135.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-21