mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 21:32:51 +09:00
Update DB classes to use new config format
This commit is contained in:
parent
6876eac464
commit
e28856bfbb
9 changed files with 70 additions and 88 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue