PHP Classes

File: core/classes/Configuration.class.php

Recommend this page to a friend!
  Classes of Yerfry Ramirez   Simple PHP OOP CMS   core/classes/Configuration.class.php   Download  
File: core/classes/Configuration.class.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: Simple PHP OOP CMS
Build Web site pages from template classes
Author: By
Last change:
Date: 9 years ago
Size: 557 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; }
}
?>