andreyizmaylov/xml-parser 问题修复 & 功能扩展

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

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

andreyizmaylov/xml-parser

最新稳定版本:1.2.2

Composer 安装命令:

composer require andreyizmaylov/xml-parser

包简介

README 文档

README

The package allows you to import data from an external XML file into a specified database table. Data mapping is defined using a mask (pattern).

Large files are read and written to the database in chunks, ensuring application stability and controlled memory usage.

The package supports resuming data import after connection loss or manual stop. Data is considered unique if it is received from a single source within a single day.

Requirements

  • PHP 8.2

Installation

composer require andrewizmaylov/XML-parser

Usage

Run the migration to create the table into which data will be imported:

(new ContentTableMigration($pdo, 'table_name'))->up();

Usage in a Service class with default:

<?php

declare(strict_types=1);

use XMLToDB\XmlParser\Service\ReedContentToDB;

class ImportToDB
{
    public static function reedData(): ParseResult 
    {
        $pdo = new PDO('mysql:host=localhost;dbname=my_database', 'root', '');
        $filePath = 'dataProvider.xml';
        $pattern = '/(<trip[^>]*>[\s\S]*?<\/trip>)/si';
    
        return (new ReedContentToDB($pdo))->reed($filePath, $pattern);
    }
}

Repository, Storage, Parser and table name could be changed.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固