Automatically create old config file if it does not exist

This commit is contained in:
Kijin Sung 2016-02-06 12:49:46 +09:00
parent 3b641c1774
commit ede85adf24
2 changed files with 7 additions and 2 deletions

View file

@ -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);
}
}
/**