Skip to content

Instantly share code, notes, and snippets.

@r3nya
Last active January 4, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r3nya/8595304 to your computer and use it in GitHub Desktop.
Save r3nya/8595304 to your computer and use it in GitHub Desktop.
<?php
class Setting {
public $values=array();
protected static $_instance = null;
private $config;
function __construct() {
$this->config = yaml_parse_from_file('file.yml');
}
public function get($value) {
return $this->config[$value];
}
public static function getInstance() {
if (self::$_instance === null) {
$c = __CLASS__;
self::$_instance = new $c;
}
return self::$_instance;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment