Skip to content

Instantly share code, notes, and snippets.

@daGrevis
Created May 7, 2012 07:14
Show Gist options
  • Select an option

  • Save daGrevis/2626411 to your computer and use it in GitHub Desktop.

Select an option

Save daGrevis/2626411 to your computer and use it in GitHub Desktop.
Conf.php (simple example)
<?php
class Conf {
private $_storage = array();
function load($name) {
$this->_storage = require $name.'.php';
}
function __get($key) {
return $this->_storage[$key];
}
}
$conf = new Conf();
$conf->load('foo');
echo $conf->foo;
?>
==========
<?php
return array(
'foo' => 'bar',
'lala' => 17,
'kitties',
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment