Skip to content

Commit

Permalink
updates public/index.php for Craft 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrrtt committed Jun 19, 2017
1 parent 9241767 commit 71dae66
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions public/index.php
@@ -1,20 +1,23 @@
<?php
/**
* Craft web bootstrap file
*/

// Project root path
$root = dirname(__DIR__);

// Composer autoloader
require_once $root.'/vendor/autoload.php';

// CraftVM
define('CRAFT_BASE_PATH', $root);

define('CRAFT_ENVIRONMENT', getenv('CRAFT_ENV_ENVIRONMENT'));
define('CRAFT_CONFIG_PATH', '../craft/config/');
define('CRAFT_STORAGE_PATH', '../craft/storage/');
define('CRAFT_TEMPLATES_PATH', '../templates/');

// Craft
$app = require $root.'/vendor/craftcms/cms/bootstrap/web.php';
$app->run();
$craftPath = '../craft';
$path = rtrim($craftPath, '/').'/app/index.php';

if (!is_file($path))
{
if (function_exists('http_response_code'))
{
http_response_code(503);
}
exit('Could not find your craft/ folder. Please ensure that <strong><code>$craftPath</code></strong> is set correctly in '.__FILE__);
}

require_once $path;

0 comments on commit 71dae66

Please sign in to comment.