php config manager
1.0.0
Cette bibliothèque permet aux développeurs d'utiliser des configurations basées sur des fichiers d'une manière facile, organisée et conviviale. La bibliothèque a été construite en gardant à l'esprit la facilité et les efforts minimaux pour le développeur. Il ne prend actuellement en charge que deux types IE JSON et PHP Arrays. Les classes de base sont facilement extensibles pour d'autres supports de type de fichiers.
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;