PHP Config Inst is a PHP library that provides a simple and efficient way to manage configuration files in PHP applications. It lets you define configuration files in various formats, including INI, JSON, XML, YAML, and others, and seamlessly load and use them in your PHP code.
Here are some examples of how to use PHP Config Inst:
1. Load an INI file:
$config = new ConfigInst\IniReader('config.ini'); $database_host = $config->get('database.host'); $database_port = $config->get('database.port');
This code loads an INI file called config.ini and retrieves the values of the database.host and database.port keys.
2. Load a JSON file:
$config = new ConfigInst\JsonReader('config.json'); $api_key = $config->get('api_key');
This code loads a JSON file called config.json and retrieves the value of the api_key key.
3. Load a YAML file:
$config = new ConfigInst\YamlReader('config.yml'); $debug_mode = $config->get('debug_mode');
This code loads a YAML file called config.yml and retrieves the value of the debug_mode key.
PHP Config Inst is part of the Composer package library and can be installed using Composer.
PHP Config::inst - 30 examples found. These are the top rated real world PHP examples of Config::inst from package huge extracted from open source projects. You can rate examples to help us improve the quality of examples.