## EXTENSION BUILDER DEFAULTS END TOKEN - Everything BEFORE this line is overwritten with the defaults of the extension builder
########################################
## INCLUDES FOR STAGING && PRODUCTION ##
########################################
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:hive_cfg_typoscript/Configuration/TypoScript/Constants/Production" extensions="txt">

##############################
## OVERRIDE FOR DEVELOPMENT ##
##############################
[like(request.getNormalizedParams().getHttpHost(), 'development.*')] || [like(request.getNormalizedParams().getHttpHost(), '*.development.*')]
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:hive_cfg_typoscript/Configuration/TypoScript/Constants/Development" extensions="txt">
[END]

#####################
## Dynamic baseURL ##
#####################
plugin.tx_hive_cfg_typoscript {
    settings {
        config {
            dynamic {
                baseURL {
                    prefix = www
                    host = muster.domain
                }
            }
        }
    }
}

##
## Dynamic baseURL
## prefix
##
[like(request.getNormalizedParams().getHttpHost(), 'development.*')] || [like(request.getNormalizedParams().getHttpHost(), '*.development.*')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.prefix = development
[END]
[like(request.getNormalizedParams().getHttpHost(), 'staging.*')] || [like(request.getNormalizedParams().getHttpHost(), '*.staging.*')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.prefix = staging
[END]
[like(request.getNormalizedParams().getHttpHost(), 'api.*')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.prefix = api
[END]
[like(request.getNormalizedParams().getHttpHost(), 'api.development.*')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.prefix = api.development
[END]

[like(request.getNormalizedParams().getHttpHost(), 'api.staging.*')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.prefix = api.staging
[END]

##
## Dynamic baseURL
## host
##
[like(request.getNormalizedParams().getHttpHost(), '*.localhost')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.host = localhost
[END]
[like(request.getNormalizedParams().getHttpHost(), '*.localhost.de')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.host = localhost.de
[END]
[like(request.getNormalizedParams().getHttpHost(), '*.localhost.ch')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.host = localhost.ch
[END]
[like(request.getNormalizedParams().getHttpHost(), '*.localhost.fr')]
    plugin.tx_hive_cfg_typoscript.settings.config.dynamic.baseURL.host = localhost.fr
[END]