Optimized demo instance localization & data handling

This commit is contained in:
Bernd Bestel
2019-09-22 08:21:15 +02:00
parent 51e0154101
commit d16f3c2daf
2 changed files with 25 additions and 30 deletions

12
app.php
View File

@@ -36,18 +36,6 @@ 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