mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-23 21:29:58 +09:00
Various changes to URL handling routines
This commit is contained in:
parent
726220d3eb
commit
c82c2f307a
4 changed files with 44 additions and 98 deletions
|
|
@ -1087,18 +1087,11 @@ class moduleController extends module
|
|||
|
||||
if(is_null($lang))
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
if(!$site_module_info)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$site_module_info = $oModuleModel->getDefaultMid();
|
||||
Context::set('site_module_info', $site_module_info);
|
||||
}
|
||||
$cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, $site_module_info->site_srl, Context::getLangType());
|
||||
$cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, 0, Context::getLangType());
|
||||
if(!file_exists($cache_file))
|
||||
{
|
||||
$oModuleAdminController = getAdminController('module');
|
||||
$oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
|
||||
$oModuleAdminController->makeCacheDefinedLangCode(0);
|
||||
}
|
||||
|
||||
if(file_exists($cache_file))
|
||||
|
|
@ -1108,7 +1101,7 @@ class moduleController extends module
|
|||
if($cacheFileMtime < $moduleAdminControllerMtime)
|
||||
{
|
||||
$oModuleAdminController = getAdminController('module');
|
||||
$oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
|
||||
$oModuleAdminController->makeCacheDefinedLangCode(0);
|
||||
}
|
||||
|
||||
require_once($cache_file);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,11 @@ class moduleModel extends module
|
|||
{
|
||||
if (strpos($domain, '/') !== false)
|
||||
{
|
||||
$domain = parse_url($domain, PHP_URL_HOST);
|
||||
$domain = Rhymix\Framework\URL::getDomainFromURL($domain);
|
||||
if ($domain === false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -117,7 +121,7 @@ class moduleModel extends module
|
|||
}
|
||||
}
|
||||
|
||||
$domain_info->site_srl = $domain_info->domain_srl;
|
||||
$domain_info->site_srl = 0;
|
||||
$domain_info->settings = $domain_info->settings ? json_decode($domain_info->settings) : new stdClass;
|
||||
$domain_info->default_language = $domain_info->settings->language ?: config('locale.default_lang');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue