Created
May 7, 2012 07:14
-
-
Save daGrevis/2626411 to your computer and use it in GitHub Desktop.
Conf.php (simple example)
This file contains hidden or 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 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