xp-forge/yaml
最新稳定版本:v9.0.0
Composer 安装命令:
composer require xp-forge/yaml
包简介
YAML parser
README 文档
README
Usage example
use org\yaml\{YamlParser, FileInput}; $result= (new YamlParser())->parse(new FileInput('.travis.yml')); // [ // language => "php" // php => [7, 7.1, 7.2, 7.3, 7.4, "nightly"] // matrix => [ // allow_failures => [[ // php => "nightly" // ]] // ] // before_script => ["curl ...", ...] // script => ["sh xp-run xp.unittest.TestRunner src/test/php"] // ]
Inputs
org.yaml.FileInput(io.File|string $in)- Use file instance or a file nameorg.yaml.ReaderInput(io.streams.TextReader $in)- Reads from a text readerorg.yaml.StringInput(string $in)- Input from a string
Multiple documents
YAML sources can contain more than one document. The parse() method will only parse the first (or only) document. To retrieve all documents in a given input, use the iterator returned by documents() instead.
use org\yaml\{YamlParser, FileInput}; use util\cmd\Console; $parser= new YamlParser(); foreach ($parser->documents(new FileInput('objects.yml')) as $i => $document) { Console::writeLine('Document #', $i, ': ', $document); }
统计信息
- 总下载量: 34.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-01-10

