承接 comphp/config-xml 相关项目开发

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

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

comphp/config-xml

Composer 安装命令:

composer require comphp/config-xml

包简介

Configuration Driver for CommonPHP which encodes/decodes the XML format

README 文档

README

Configuration driver for CommonPHP that encodes and decodes the CommonPHP XML configuration format.

Requirements

  • PHP ^8.5
  • PHP DOM extension ext-dom
  • comphp/config:^0.3

Installation

Once this package is available through your Composer repositories, install it with:

composer require comphp/config-xml

Usage

<?php

use CommonPHP\Drivers\Config\XML\XmlConfigurationDriver;

$driver = new XmlConfigurationDriver();

$config = [
    'app' => 'demo',
    'debug' => true,
    'database' => [
        'host' => 'localhost',
    ],
];

$xml = $driver->encode($config);
$decoded = $driver->decode($xml);

$driver->write(__DIR__ . '/config.xml', $config);
$fromFile = $driver->read(__DIR__ . '/config.xml');

Format Notes

This package uses the CommonPHP XML config format with a <config> root and typed <entry> elements. It is not an arbitrary XML-to-array converter. DOCTYPE declarations are rejected.

Error Handling

Read, write, parse, validation, and unsupported value failures throw CommonPHP config exceptions such as ConfigReadException, ConfigWriteException, ConfigValidationException, or ConfigException.

Documentation

License

MIT. See LICENSE.md.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固