PHP Classes

File: config.class.php

Recommend this page to a friend!
  Classes of Yerfry Ramirez   Simple Configurations class   config.class.php   Download  
File: config.class.php
Role: Class source
Content type: text/plain
Description: The class source
Class: Simple Configurations class
Set and get configuration values in static vars
Author: By
Last change: None
Date: 9 years ago
Size: 575 bytes
 

Contents

Class file image Download
<?php

class Configuration {
    protected static
$ConfigurationSetting = [];
    public static function
set($Name, $Value = null) {
        if(
is_array($Name) && count($Name) > 0 && is_null($Value)):
           
Configuration::addArray($Name); else:
           
Configuration::$ConfigurationSetting[$Name] = $Value;
        endif;
    }

    public static function
get($Name) { if(array_key_exists($Name, Configuration::$ConfigurationSetting)) return Configuration::$ConfigurationSetting[$Name]; }
    protected static function
addArray($Array) { Configuration::$ConfigurationSetting += $Array; }
}

?>