fabrn/ydk-file-reader
Composer 安装命令:
composer require fabrn/ydk-file-reader
包简介
Simple PHP library for YDK file reading
README 文档
README
Simple PHP library that make .ydk file reading easier.
Install using Composer
composer require fabrn/ydkfilereader
Usage
In order to parse a specific YDK file, the Ydk::readFile will do the job :
$ydk = Ydk::readFile('my_file.ydk');
Once you've done that, you get an Ydk instance that contains everything you need
to read the parsed file using public properties :
- author : if mentioned, the author can be retrieved
- mainDeck : list of card IDs of the main deck
- extraDeck : list of card IDs of the extra deck
- sideDeck : list of card IDs of the side deck
Using a custom parser
If, for some reason, you need to use a custom YDK parser, you can create one :
class MyYdkParser implements YdkParserInterface { public function parse(string $ydk): array { // TODO : parse YDK content } }
Then use the parser by giving it as a second argument to the readFile method :
$ydk = Ydk::readFile('my_file.ydk', new MyYdkParser());
Directly parse YDK content
The Ydk class' constructor takes some raw YDK content to parse. The readFile is
useful to get a file's content and construct the Ydk instance with it. But, if you
need to, you can give it yourself :
$ydk = new Ydk($ydkContent);
Note that you can also use a custom parser using the constructor :
$ydk = new Ydk($ydkContent, new MyYdkParser());
License and legal notice
This package is available under MIT license.
fabrn/ydk-file-reader 适用场景与选型建议
fabrn/ydk-file-reader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fabrn/ydk-file-reader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fabrn/ydk-file-reader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-21