Internal change that the demo instances (stable and pre-release) can be served through a single instance for all localizations (references #241)

This commit is contained in:
Bernd Bestel
2019-09-21 15:07:29 +02:00
parent 6e4117526b
commit d8360993cc
14 changed files with 65 additions and 22 deletions

14
app.php
View File

@@ -36,9 +36,21 @@ else
// Load composer dependencies
require_once __DIR__ . '/vendor/autoload.php';
// Definitions for the official demo instances
// running on "<localization>.demo.grocy.info" and "<localization>.demo-prerelease.grocy.info
// The language should automatically be determined by the subdomain
if (string_ends_with(strtolower($_SERVER['HTTP_HOST']), 'grocy.info'))
{
$cultureBySubdomain = explode('.', $_SERVER['HTTP_HOST'])[0];
if (file_exists(__DIR__ . "/localization/$cultureBySubdomain") && is_dir(__DIR__ . "/localization/$cultureBySubdomain"))
{
define('GROCY_CULTURE', $cultureBySubdomain);
}
}
// Load config files
require_once GROCY_DATAPATH . '/config.php';
require_once __DIR__ . '/config-dist.php'; //For not in own config defined values we use the default ones
require_once __DIR__ . '/config-dist.php'; // For not in own config defined values we use the default ones
// Definitions for disabled authentication mode
if (GROCY_DISABLE_AUTH === true)