laravie/parser 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

laravie/parser

最新稳定版本:v3.0.0

Composer 安装命令:

composer require laravie/parser

包简介

XML Document Parser for PHP

关键字:

README 文档

README

Parser Component is a framework agnostic package that provide a simple way to parse XML to array without having to write a complex logic.

tests Latest Stable Version Total Downloads Latest Unstable Version License Coverage Status

Imagine if you can parse

<api>
    <user followers="5">
        <id>1</id>
        <email>crynobone@gmail.com</email>
    </user>
</api>

to

<?php

$user = [
    'id' => '1',
    'email' => 'crynobone@gmail.com',
    'followers' => '5'
];

by just writing this:

<?php

use Laravie\Parser\Xml\Reader;
use Laravie\Parser\Xml\Document;

$xml = (new Reader(new Document()))->load('path/to/above.xml');

$user = $xml->parse([
    'id' => ['uses' => 'user.id'],
    'email' => ['uses' => 'user.email'],
    'followers' => ['uses' => 'user::followers'],
]);

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "laravie/parser": "^2.0"
    }
}

And then run composer install from the terminal.

Quick Installation

Above installation can also be simplify by using the following command:

composer require "laravie/parser=^2.0"

统计信息

  • 总下载量: 1.99M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 234
  • 点击次数: 1
  • 依赖项目数: 9
  • 推荐数: 1

GitHub 信息

  • Stars: 231
  • Watchers: 6
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-18