Created
February 6, 2014 08:33
-
-
Save ruliarmando/8840341 to your computer and use it in GitHub Desktop.
simple Config class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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