diff --git a/classes/Kohana/Config/File.php b/classes/Kohana/Config/File.php index 4b4c3d7f1..9b4076591 100644 --- a/classes/Kohana/Config/File.php +++ b/classes/Kohana/Config/File.php @@ -1,6 +1,6 @@ _loaded_keys[$group] = $config; + } + + return $config; + } + + /** + * Writes the passed config for $group + * + * Returns chainable instance on success + * + * @param string $group The config group + * @param string $key The config key to write to + * @param array $config The configuration to write + * @return boolean + */ + public function write($group, $key, $config) + { + $this->_loaded_keys[$group][$key] = $config; + + $config_file = APPPATH.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.$group.'.php'; + + $result = file_put_contents($config_file, "_loaded_keys[$group], TRUE).';'); + + return $result !== FALSE; + } +}