PHP Classes

Dframe Config File: Load configuration values from scripts with arrays

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 60 All time: 10,511 This week: 455Up
Version License PHP version Categories
dframe-config 4.1.7The PHP License7PHP 5, Configuration
Description 

Author

This class can load configuration values from scripts with arrays.

It takes as parameter the path of a PHP script with configuration values defined as array.

The class loads configuration file and returns the individual configuration values using a getter function.

Picture of Slawomir Kaleta
  Performance   Level  
Name: Slawomir Kaleta <contact>
Classes: 16 packages by
Country: Poland Poland
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Documentation

Dframe/Config - Component

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

php framework dframe logo

Documentation - Config PHP

Composer

$ composer require dframe/config

Standalone

use Dframe\Config\Config;

include_once 'vendor/autoload.php';
$configPath = __DIR__. DIRECTORY_SEPARATOR . 'config'. DIRECTORY_SEPARATOR;

$config = Config::load('ConfigFile', $configPath);
$config->get('key1'); // Return value
$config->get('keyValid', 'yes'); // return 'yes' ||  if key does not exist then you can replace value

License

Open-sourced software licensed under the MIT license


  Files folder image Files (5)  
File Role Description
Files folder imageExceptions (1 file)
Files folder imageTests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Plain text file Config.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (5)  /  Exceptions  
File Role Description
  Plain text file ConfigException.php Class Class source

  Files folder image Files (5)  /  Tests  
File Role Description
  Plain text file ConfigTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:60
This week:0
All time:10,511
This week:455Up