Skip to content

Instantly share code, notes, and snippets.

@eriweb
Created March 14, 2017 07:24
Show Gist options
  • Save eriweb/682f23ce736a12285c1bba156a72223b to your computer and use it in GitHub Desktop.
Save eriweb/682f23ce736a12285c1bba156a72223b to your computer and use it in GitHub Desktop.
<?php
/**
* Craft web bootstrap file
*/
// Set the Craft site variable
define('CRAFT_SITE', 'blabla');
// Project root path
$root = dirname(__DIR__);
// Composer autoloader
require_once $root.'/vendor/autoload.php';
// dotenv?
if (file_exists($root.'/.env')) {
$dotenv = new Dotenv\Dotenv($root);
$dotenv->load();
}
// Craft
define('CRAFT_BASE_PATH', $root);
$app = require $root.'/vendor/craftcms/cms/bootstrap/web.php';
$app->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment