openthc/cre-adapter
Composer 安装命令:
composer require openthc/cre-adapter
包简介
OpenTHC Cannabis Reporting Engine API Adapters
README 文档
README
API Adapters for BioTrack, METRC and other Cannabis Regulatory Engines. These scripts expose a common interface for these different API interfaces.
Examples
There is a convenience factory method to use with the proper configuration (loaded from etc/cre.yaml).
$cfg = \OpenTHC\CRE::getConfig('usa-wa'); $cre = \OpenTHC\CRE::factory($cfg); $res = $cre->license()->search(); $res = $cre->crop()->search(); foreach ($res as $rec) { echo $rec['variety']['name'] . "\n"; } $res = $cre->inventory()->search(); foreach ($res as $rec) { echo $rec['id'] . ' ' . $rec['product_id'] . "\n"; }
Supported Cannabis Reporting Engines
- BioTrack: Hawai'i, Illinois, New Mexico, Puerto Rico
- METRC: Alaska, California, Colorado, Maine, Massachusetts, Michigan, Montana, Nevada, Oklahoma, Oregon, etc
Other engines will be added, of course :) Some of the engine specific adapters are very thin layers, they really only exist for consistency.
Connect
$cre = \OpenTHC\CRE::factory($cfg); $cre->ping();
Reading Objects
A low level, GET and POST/PUT interface exists.
$res = $cre->get('/object?page=0&sort=created_at'); $res = $cre->post('/object', $arg); $res = $cre->put('/object/id', $arg);
High Level API
It's also possible to interface with the objects at a higher level.
$obj_list = $cre->license()->search($arg); $obj = $cre->license()->single($oid); $res = $cre->license()->create($obj); $res = $cre->license()->update($oid, $obj);
openthc/cre-adapter 适用场景与选型建议
openthc/cre-adapter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.15k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 02 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 openthc/cre-adapter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 openthc/cre-adapter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-01