Created
April 13, 2015 17:00
-
-
Save tburry/e82c45a04b31d3489aa5 to your computer and use it in GitHub Desktop.
A boostrap.before for multiple Vanilla installations in one folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file will make Vanilla use a different config depending on which site you're on. | |
* Drop this file into your /conf folder. | |
*/ | |
// Get the config. | |
if (isset($_SERVER['NODE_SLUG'])) { | |
// This is a site per folder setup. | |
$slug = "vanilla.dev-{$_SERVER['NODE_SLUG']}"; | |
} else { | |
// This is a site per host setup. | |
$host = $_SERVER['HTTP_HOST']; | |
if (in_array($host, ['vanilla.local', 'vanilla.lc'])) { | |
$slug = 'config'; | |
} else { | |
$slug = $host; | |
} | |
} | |
// Use a config specific to the site. | |
$configPath = PATH_ROOT."/conf/$slug.php"; | |
define('PATH_CONF_DEFAULT', $configPath); | |
if (!defined('CLIENT_NAME')) { | |
define('CLIENT_NAME', 'toddo.vanilla.local'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment