mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
Update installer to use new config format
This commit is contained in:
parent
28af7b95cf
commit
0b1fa79f43
15 changed files with 287 additions and 424 deletions
|
|
@ -487,11 +487,14 @@ class Context
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function loadDBInfo()
|
||||
public static function loadDBInfo($config = null)
|
||||
{
|
||||
// Load new configuration format.
|
||||
$config = Rhymix\Framework\Config::init();
|
||||
if(!count($config))
|
||||
if ($config === null)
|
||||
{
|
||||
$config = Rhymix\Framework\Config::init();
|
||||
}
|
||||
if (!count($config))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -620,9 +623,16 @@ class Context
|
|||
{
|
||||
$supported = Rhymix\Framework\Lang::getSupportedList();
|
||||
$selected = Rhymix\Framework\Config::get('locale.enabled_lang');
|
||||
foreach ($selected as $lang)
|
||||
if ($selected)
|
||||
{
|
||||
$lang_selected[$lang] = $supported[$lang];
|
||||
foreach ($selected as $lang)
|
||||
{
|
||||
$lang_selected[$lang] = $supported[$lang];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$lang_selected = $supported;
|
||||
}
|
||||
}
|
||||
return $lang_selected;
|
||||
|
|
|
|||
|
|
@ -132,14 +132,21 @@ class ModuleHandler extends Handler
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$urlInfo = parse_url($url);
|
||||
$host = $urlInfo['host'];
|
||||
|
||||
$dbInfo = Context::getDBInfo();
|
||||
$defaultUrlInfo = parse_url($dbInfo->default_url);
|
||||
$defaultHost = $defaultUrlInfo['host'];
|
||||
|
||||
|
||||
$defaultUrl = Context::getDBInfo()->default_url;
|
||||
if($defaultUrl)
|
||||
{
|
||||
$defaultUrlInfo = parse_url($defaultUrl);
|
||||
$defaultHost = $defaultUrlInfo['host'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaultHost = $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
|
||||
if($host && ($host != $defaultHost && $host != $site_module_info->domain))
|
||||
{
|
||||
throw new Exception('msg_default_url_is_null');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue