Skip to content

Instantly share code, notes, and snippets.

@ruliarmando
Created February 6, 2014 08:33
Show Gist options
  • Save ruliarmando/8840341 to your computer and use it in GitHub Desktop.
Save ruliarmando/8840341 to your computer and use it in GitHub Desktop.
simple Config class
<?php
class Config {
private static $items = array();
public static function load($config_file){
self::$items = require $config_file;
}
public static function get($key, $default=null){
if(isset(self::$items[$key])){
return self::$items[$key];
}
return $default;
}
public static function set($key, $value){
self::$items[$key] = $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment