1<?php
2/**
3 * Multisite support for phpMyFAQ.
4 *
5 * HowTo:
6 *  - Rename this file to <DOCROOT>/multisite/multisite.php
7 *      i.e. /srv/www/faq.example.org/multisite/multisite.php
8 *  - create a folder that's called like the SERVER_NAME inside <DOCROOT>/multi/
9 *      i.e. /srv/www/faq.example.org/multisite/otherfaq.example.org
10 *  - that is your config folder with the usual contents like database.php
11 *
12 * If you don't plan to use multisite support, just delete the multisite directory.
13 *
14 * This Source Code Form is subject to the terms of the Mozilla Public License,
15 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
16 * obtain one at http://mozilla.org/MPL/2.0/.
17 *
18 * @package phpMyFAQ
19 * @package   Multisite
20 * @author Florian Anderiasch <florian@phpmyfaq.de>
21 * @copyright 2012-2020 phpMyFAQ Team
22 * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
23 * @link https://www.phpmyfaq.de
24 * @since 2012-04-14
25 */
26
27$protocol = 'http';
28if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
29    $protocol = 'https';
30}
31$parsed = parse_url($protocol.'://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
32if (isset($parsed['host']) && strlen($parsed['host']) > 0 && is_dir(__DIR__.'/'.$parsed['host'])) {
33    define('PMF_MULTI_INSTANCE_CONFIG_DIR', __DIR__.'/'.$parsed['host']);
34    unset($parsed);
35}
36