/** * * Test -- Fetches config file values. * */ public function testFetch() { $file = Solar_Class::dir('Mock_Solar_Config') . 'fetch.php'; $actual = Solar_Config::fetch($file); $expect = array('foo' => 'bar', 'baz' => 'sub', 'zim' => 'gir'); $this->assertSame($actual, $expect); }
/** * * Loads the config values from the specified location. * * @param mixed $spec A config specification. * * @see fetch() * * @return void * */ public static function load($spec) { Solar_Config::$_store = Solar_Config::fetch($spec); Solar_Config::$_build = array(); $callback = Solar_Config::get('Solar_Config', 'load_callback'); if ($callback) { $merge = (array) call_user_func($callback); Solar_Config::$_store = array_merge(Solar_Config::$_store, $merge); } }