PHP 8.4.2 Released!

简介

Yet Another Configurations Container (Yaconf) is a configurations container, it parses INI files, and store the result in PHP when PHP is started, the result lives with the whole PHP lifecycle.

Yaconf stores all configurations as interned string or immutable array, which means they are not refcounted-able, thus when you retrieving configurations from Yaconf, it could be considered as zero-copy, very fast.

Yaconf supports sections and sections inheritance in INI files. If PHP is built as non-ZTS build, Yaconf also supports automatically reloading after INI files are changed.

Yaconf requires PHP 7.0 or greater.

示例 #1 INI example

;Simple key val
key=val

;Hash
hash.a=val

;Array
arr.0=val
;or
arr[]=val

;PHP constant
version=PHP_VERSION

;Environment variable
env=${PATH}

示例 #2 INI sections example

[SectionA]
key=val
hash.a=val

;SectionB inherits SectionA
[SectionB:SectionA]
key=new_val                  ;override configuration key in SectionA
添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top