der-spiegel/amendo-client
Composer 安装命令:
composer require der-spiegel/amendo-client
包简介
PHP client for OneVision Amendo https://www.onevision.com/solutions/image-editing/amendo/
README 文档
README
OneVision Amendo is automated image enhancement software. This PHP client library uses its REST API.
This is not an official library supplied by the OneVision vendor. It has been developed for the WoodWing Assets project at the German SPIEGEL Gruppe, 2020.
Installation
Use Composer to add this library your project’s composer.json file:
$ composer require der-spiegel/amendo-client
Developing this library
If you want to help developing this library, Here’s how to get started (Docker required):
Install dependencies using Composer
$ docker run --rm --interactive --tty \
--volume $PWD:/app \
--volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
composer/composer install
Use the library
The UsageExample.php example script can be used without modification by
setting the environment variable AMENDO_SERVER to the Amendo server
base URL, AMENDO_ASSEMBLYLINE the name of the Amendo assembly line and
AMENDO_FILEPATH to a file path, that should be processed by the
assembly line.
The script will create a new job for the specified file using the specified assembly line. Some custom job and file properties are submitted with the job ticket to the Amendo server, that can be used to configure modules used in the assembly line.
For more advanced usage create a copy of the
UsageExample.php example file
$ cp UsageExample.php MyExample.php
and modify the copied file accordingly.
Example source code explained
Create an AmendoConfig object refering to the Amendo server:
$amendoConfig = new AmendoConfig($amendoServerUrl);
Create an AmendoClient object using the AmendoConfig object:
$amendoClient = new AmendoClient($amendoConfig, $logger);
Create a SimpleJobTicket object:
$jobTicket = new SimpleJobTicket();
Optional: Set job name:
If no job name is set, a generated job name is used.
$jobTicket->setJobName('Test-' . time());
Set assembly line to use:
$jobTicket->setAssemblyLineReference($assemblyLine);
Optional: Set a job priority:
If no priority is set, no priority is submitted to the Amendo server.
$jobTicket->setJobPriority(60);
Optional: Add job properties to the job:
$jobTicket->setStringProperty('Custom', 'AString', 'Text'); $jobTicket->setBooleanProperty('Custom', 'ABool', true); $jobTicket->setIntegerProperty('Custom', 'AnInteger', 42); $jobTicket->setFloatProperty('Custom', 'AFloat', 0.815);
The first argument of each method call specifies the list name to add the property to. The second argument secifies the property name and the third argument its value.
The first line adds a property of type string, the second line a property of type boolean, the third line a property of type integer and the fourth lie a property of type floating point to the job properties.
Add one or more files to the job's run list:
Use
$file = $jobTicket->addFile($filePath);
for regular local files or
$file = $jobTicket->addUri($filePath);
for file URI's or
$file = $jobTicket->addDownloadUri($filePath);
for download URI's.
Optional: Add file properties to the added file:
$file->setStringProperty('Custom', 'AString', 'FileText'); $file->setBooleanProperty('Custom', 'ABool', false); $file->setIntegerProperty('Custom', 'AnInteger', 15); $file->setFloatProperty('Custom', 'AFloat', 3.1415);
See job properties above for details.
Submit the SimpleJobTicket to the Amendo server.
$jobId = $amendoClient->startJobTicket($jobTicket);
On success a positive $jobId is returned by the Amendo server.
On error, either an exception is thrown or the Amendo server returns 0.
Optional: Querying the job overview:
$result = $amendoClient->getJobOverview($jobId);
Returns an array whose contents depends on the current status of the job.
Then run your copy
$ docker run -it --rm --name amendo-client-example \
--volume "$PWD":/usr/src/myapp --workdir /usr/src/myapp \
php:8.5-cli php MyExample.php
Authors
License
This library is licensed under the MIT License - see the LICENSE file for
details.
der-spiegel/amendo-client 适用场景与选型建议
der-spiegel/amendo-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.78k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 11 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 der-spiegel/amendo-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 der-spiegel/amendo-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-16