Skip to content

Instantly share code, notes, and snippets.

@dwolfhub
Last active August 29, 2015 14:13
Show Gist options
  • Save dwolfhub/797a0f4f8b4c75da824a to your computer and use it in GitHub Desktop.
Save dwolfhub/797a0f4f8b4c75da824a to your computer and use it in GitHub Desktop.
Bolt index.php with environment config support
<?php
require_once "../vendor/autoload.php";
$configuration = new Bolt\Configuration\Composer(dirname(__DIR__));
$configuration->setPath("web", "public_html");
$configuration->setPath("files", "public_html/files");
$configuration->setPath("themebase", "public_html/theme");
$applicationEnv = getenv('APPLICATION_ENV');
if ($applicationEnv and is_dir('app/config/' . $applicationEnv)) {
$configuration->setPath('configpath', 'app/config/' . $applicationEnv);
$configuration->setPath('config', 'app/config/' . $applicationEnv);
} else {
$configuration->setPath('configpath', 'app/config/default');
$configuration->setPath('config', 'app/config/default');
}
$configuration->getVerifier()->disableApacheChecks();
$configuration->verify();
$app = new Bolt\Application(array('resources' => $configuration));
$app->initialize();
$app->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment