algm/largexmlreader 问题修复 & 功能扩展

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

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

algm/largexmlreader

Composer 安装命令:

composer require algm/largexmlreader

包简介

Read and process HUGE xml files

README 文档

README

Read and process HUGE Xml files from any source.

Description

This package allows to process large XML files with repeating items using PHP 7+.

Usage

Import the Reader class and use one of the two static constructors.

<?php

use Algm\LargeXmlReader\Xml\Reader;

$xmlStream = fopen($xmlFilePath, 'r');

// open the stream to read all nodes recursively (defaults to two levels)
$reader = Reader::openStream($xmlStream);

// or set the reader to find all repeating <item /> tags
$reader = Reader::openUniqueNodeStream($xmlStream, 'item');

In general, the unique node stream performs better than the normal one.

IMPORTANT LIMITATION: Unique node reader does not support nested nodes with the same tag.

Once you get the reader instance, use the process method to retrieve a generator for the nodes.

You can use this generator as an iterator.

<?php

$iterator = $reader->process();

foreach ($iterator as $nodeData) {
    // do something with the node
}

The process method accepts a limit param to read a maximum of $limit nodes.

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固