activecollab/configfile 问题修复 & 功能扩展

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

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

activecollab/configfile

最新稳定版本:1.0.1

Composer 安装命令:

composer require activecollab/configfile

包简介

Get constants from a configuration file written in PHP

README 文档

README

Build Status

Simple utility for getting constants from configuration files written in PHP.

Installation

To install it, use Composer:

{ "require": { "activecollab/configfile": "~1.0" } }

Usage

If we have a config.example.php file that looks like this:

<?php const ONE = 1; define ('TWO', 2); defined ('THREE') or define('THREE', 3); const THIS_IS_TRUE = true; define ("THIS_IS_FALSE", false); const SINGLE_QUOTED_STRING = 'single'; const DOUBLE_QUOTED_STRING = 'double'; define('FLOAT', 2.25); // Declaration in comment should be ignored define('IGNORE_ME', true); // Same thing about const THIS_SHOULD_BE_IGNORED = true;

and we parse it like this:

<?php use ActiveCollab\ConfigFile\ConfigFile; $config_file = new ConfigFile('config.example.php'); var_dump($config_file->getOptions());

we'll get:

array(8) { ["ONE"]=> int(1) ["TWO"]=> int(2) ["THREE"]=> int(3) ["THIS_IS_TRUE"]=> bool(true) ["THIS_IS_FALSE"]=> bool(false) ["SINGLE_QUOTED_STRING"]=> string(6) "single" ["DOUBLE_QUOTED_STRING"]=> string(6) "double" ["FLOAT"]=> float(2.25) } 

To Do

This library has been created in a bit of a rush, so there are still some things to do:

  1. const should be parsed using tokenizer
  2. Follow included files using include and require [?]
  3. Library should be able to modify and write config files [?]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固