Update DB classes to use new config format

This commit is contained in:
Kijin Sung 2016-02-05 14:46:55 +09:00
parent 6876eac464
commit e28856bfbb
9 changed files with 70 additions and 88 deletions

View file

@ -100,6 +100,17 @@ class Config
$data = $value;
}
/**
* Set all system configuration.
*
* @param array $config
* @return void
*/
public static function setAll($config)
{
self::$_config = $config;
}
/**
* Convert previous configuration files to the current format and return it.
*
@ -345,8 +356,11 @@ class Config
*/
public static function save($config = null)
{
$config = ($config === null) ? self::$_config : $config;
$buff = '<?php' . "\n" . '// Rhymix System Configuration' . "\n" . 'return ' . self::serialize($config) . ';' . "\n";
if ($config)
{
self::setAll($config);
}
$buff = '<?php' . "\n" . '// Rhymix System Configuration' . "\n" . 'return ' . self::serialize(self::$_config) . ';' . "\n";
return \FileHandler::writeFile(RX_BASEDIR . 'files/config/config.php', $buff) ? true : false;
}