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

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

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

comphp/config-php

Composer 安装命令:

composer require comphp/config-php

包简介

Configuration Driver for CommonPHP which includes/builds PHP include files that return arrays

README 文档

README

Configuration driver for CommonPHP that writes and reads PHP files returning configuration arrays.

Requirements

  • PHP ^8.5
  • comphp/config:^0.3

Installation

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

composer require comphp/config-php

Usage

<?php

use CommonPHP\Drivers\Config\PHP\PhpConfigurationDriver;

$driver = new PhpConfigurationDriver();

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

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

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

Format Notes

PHP config files must return an array. This driver includes PHP files when decoding or reading, so configuration files are trusted code and are executed by PHP.

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固