承接 xp-forge/yaml 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xp-forge/yaml

最新稳定版本:v9.0.0

Composer 安装命令:

composer require xp-forge/yaml

包简介

YAML parser

关键字:

README 文档

README

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.4+ Supports PHP 8.0+ Latest Stable Version

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 name
  • org.yaml.ReaderInput(io.streams.TextReader $in) - Reads from a text reader
  • org.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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-01-10