Skip to content

Instantly share code, notes, and snippets.

@tburry
Created April 13, 2015 17:00
Show Gist options
  • Save tburry/e82c45a04b31d3489aa5 to your computer and use it in GitHub Desktop.
Save tburry/e82c45a04b31d3489aa5 to your computer and use it in GitHub Desktop.
A boostrap.before for multiple Vanilla installations in one folder.
<?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