php config manager
1.0.0
이 라이브러리를 사용하면 개발자가 쉽고 구성된 구문 친화적 인 방식으로 파일 기반 구성을 사용할 수 있습니다. 도서관은 개발자를 염두에두고 편안하고 최소한의 노력을 기울였습니다. 현재 JSON 및 PHP 배열의 두 가지 유형 만 지원합니다. 기본 클래스는 추가 파일 유형 지원을 위해 쉽게 확장 할 수 있습니다.
composer require amanangira/php-config-manager
git clone https://github.com/amanangira/php-config-manager.git
use AmanAngiraConfigManagerPhpArrayManager;
$path = __DIR__ . '/config'; //Directory where the library expects the configuration files
$manager = new Manager($path); //Initializing object with the configurations path
use AmanAngiraConfigManagerJsonManager;
$path = __DIR__ . '/config'; //Directory where the library expects the configuration files
$manager = new Manager($path); //Initializing object with the configurations path
$value = $manager->get('foo.var'); //use file name only (without extension) followed by full stop to access child values
if( $value === Manager::NOT_FOUND_FLAG ) //library flag if a value is not defined
echo "Value not defined";
else
echo $value;