Fix #801 autodetect http or https port on installation

This commit is contained in:
Kijin Sung 2017-05-07 22:23:26 +09:00
parent 141aabdaf7
commit 4d1df5701d

View file

@ -22,14 +22,15 @@ class module extends ModuleObject
if(!getModel('module')->getDefaultDomainInfo())
{
$current_url = Rhymix\Framework\Url::getCurrentUrl();
$current_port = intval(parse_url($current_url, PHP_URL_PORT)) ?: null;
$domain = new stdClass();
$domain->domain_srl = 0;
$domain->domain = Rhymix\Framework\URL::getDomainFromURL($current_url);
$domain->is_default_domain = 'Y';
$domain->index_module_srl = 0;
$domain->index_document_srl = 0;
$domain->http_port = null;
$domain->https_port = null;
$domain->http_port = RX_SSL ? null : $current_port;
$domain->https_port = RX_SSL ? $current_port : null;
$domain->security = config('url.ssl') ?: 'none';
$domain->description = '';
$domain->settings = json_encode(array('language' => null, 'timezone' => null));