PHP Classes

Simple Configurations class: Set and get configuration values in static vars

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 139 All time: 9,215 This week: 571Up
Version License PHP version Categories
simple-configuration 1.0GNU General Publi...5PHP 5, Configuration
Description 

Author

This class can set and get configuration values in static variables.

It can set individual values with given names or of a set of values passing an associative array of values.

The stored individual configuration values can be retrieved from anywhere in the application.

Picture of Yerfry Ramirez
  Performance   Level  
Name: Yerfry Ramirez is available for providing paid consulting. Contact Yerfry Ramirez .
Classes: 7 packages by
Country: Sweden Sweden
Age: ???
All time rank: 184018 in Sweden Sweden
Week rank: 411 Up5 in Sweden Sweden Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php

require 'config.class.php';

Configuration::set('MySQL', [
   
'Hostname' => '127.0.0.1',
   
'Username' => 'root',
   
'Password' => 'root',
   
'Database' => 'database'
]);

Configuration::set([
   
'Example1' => 'Value1',
   
'Example2' => 'Value2'
]);

Configuration::set('Test', 'Value');

print_r(Configuration::get('MySQL'));

echo
'<br />';

echo
Configuration::get('Example1');

echo
'<br />';

echo
Configuration::get('Example2');

echo
'<br />';

echo
Configuration::get('Test');
?>


  Files folder image Files  
File Role Description
Accessible without login Plain text file Example.config.php Example A simple explanation of usage
Plain text file config.class.php Class The class source

 Version Control Unique User Downloads Download Rankings  
 0%
Total:139
This week:0
All time:9,215
This week:571Up