koriym/data-file 问题修复 & 功能扩展

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

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

koriym/data-file

最新稳定版本:1.0.1

Composer 安装命令:

composer require koriym/data-file

包简介

Load XML file with XSD validation

README 文档

README

Scrutinizer Code Quality Type Coverage codecov Continuous Integration

XML Config Loader

This library helps you easily validate and load XML configuration files using XSD schemas. It's designed to ensure the integrity and consistency of your configuration data with minimal effort. Additionally, it can be used to load and validate general XML files.

Installation

To get started, install the required package using Composer:

composer require koriym/data-file

Validate and load the XML file.

Usage

Simple XML Load with Validation

Load and validate your XML files with just a few lines of code:

use Koriym\DataFile\XmlLoad;

$xml = (new XmlLoad())('/path/to/xml', '/path/to/xsd');
assert($xml instanceof SimpleXMLElement);

Config XML Load

Easily load configuration files (config.xml or config.xml.dist) from the specified directory. If both files are present, config.xml is loaded first:

use Koriym\DataFile\XmlConfigLoad;

$xml = (new XmlConfigLoad('confilg.xml'))('/path/to/config_dir', '/path/to/xsd');
assert($xml instanceof SimpleXMLElement);

Using .dist files allows you to maintain default settings in your repository while keeping local configurations separate.

Notes

  • The XSD schema ensures your XML files adhere to the defined structure and content standards.
  • .dist files are useful for providing default configurations that can be overridden by local settings.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-13