Update installer to use new config format

This commit is contained in:
Kijin Sung 2016-02-03 15:39:58 +09:00
parent 28af7b95cf
commit 0b1fa79f43
15 changed files with 287 additions and 424 deletions

View file

@ -43,6 +43,16 @@ class Config
return self::$_config;
}
/**
* Get default system configuration.
*
* @return array
*/
public static function getDefaults()
{
return (include RX_BASEDIR . 'common/defaults/config.php');
}
/**
* Get a system configuration value.
*
@ -332,15 +342,13 @@ class Config
/**
* Save the current system configuration.
*
* @param array $config (optional)
* @return bool
*/
public static function save()
public static function save($config = null)
{
if (!count(self::$_config))
{
self::init();
}
$buff = '<?php' . "\n" . '// Rhymix System Configuration' . "\n" . 'return ' . self::serialize(self::$_config) . ';' . "\n";
$config = ($config === null) ? self::$_config : $config;
$buff = '<?php' . "\n" . '// Rhymix System Configuration' . "\n" . 'return ' . self::serialize($config) . ';' . "\n";
return \FileHandler::writeFile(RX_BASEDIR . 'files/config/config.php', $buff) ? true : false;
}