php config manager
1.0.0
Perpustakaan ini memungkinkan pengembang untuk menggunakan konfigurasi berbasis file dengan cara yang mudah, terorganisir, dan ramah sintaks. Perpustakaan telah dibangun menjaga kemudahan dan upaya minimal untuk mempertimbangkan pengembang. Saat ini hanya mendukung dua jenis yaitu array JSON dan PHP. Kelas dasar mudah diperpanjang untuk dukungan jenis file lebih lanjut.
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;