mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 07:11:42 +09:00
Automatically create old config file if it does not exist
This commit is contained in:
parent
3b641c1774
commit
ede85adf24
2 changed files with 7 additions and 2 deletions
|
|
@ -530,6 +530,11 @@ class Context
|
|||
// Save old format to Context instance.
|
||||
self::$_instance->allow_rewrite = $config['use_rewrite'];
|
||||
self::$_instance->db_info = $db_info;
|
||||
if (!file_exists($old_config_file = self::getConfigFile()))
|
||||
{
|
||||
$buff = '<?php' . "\n" . '$db_info = ' . Rhymix\Framework\Config::serialize($db_info) . ';' . "\n";
|
||||
FileHandler::writeFile($old_config_file, $buff);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ class Config
|
|||
$config['lock']['message'] = strval($db_info->sitelock_message);
|
||||
if (!is_array($db_info->sitelock_whitelist))
|
||||
{
|
||||
$db_info->sitelock_whitelist = array_map('trim', explode(',', trim($db_info->sitelock_whitelist)));
|
||||
$db_info->sitelock_whitelist = $db_info->sitelock_whitelist ? array_map('trim', explode(',', trim($db_info->sitelock_whitelist))) : array();
|
||||
}
|
||||
if (!in_array('127.0.0.1', $db_info->sitelock_whitelist))
|
||||
{
|
||||
|
|
@ -394,7 +394,7 @@ class Config
|
|||
{
|
||||
if (is_object($value))
|
||||
{
|
||||
return '(object)' . self::serializeValue((array)$value);
|
||||
return '(object)' . self::serialize((array)$value);
|
||||
}
|
||||
elseif (is_array($value))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue