Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates public/index.php for Craft 2.6
- Loading branch information
Showing
1 changed file
with
15 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |