Skip to content

Commit

Permalink
Check env
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed Feb 22, 2022
1 parent 99cc589 commit 0efca07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion craft
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ if (file_exists(CRAFT_BASE_PATH.'/.env')) {
}

define('CRAFT_STREAM_LOG', true);
define('CRAFT_ENVIRONMENT', App::env('ENVIRONMENT') ?: 'production');
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');

if ($storagePath = getenv('CRAFT_STORAGE_PATH')) {
define('CRAFT_STORAGE_PATH', $storagePath);
}

if ($ephemeral = getenv('CRAFT_EPHEMERAL')) {
define('CRAFT_EPHEMERAL', filter_var($ephemeral, FILTER_VALIDATE_BOOL));
}

// Craft
$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/console.php';
Expand Down
8 changes: 8 additions & 0 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
define('CRAFT_STREAM_LOG', true);
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');

if ($storagePath = getenv('CRAFT_STORAGE_PATH')) {
define('CRAFT_STORAGE_PATH', $storagePath);
}

if ($ephemeral = getenv('CRAFT_EPHEMERAL')) {
define('CRAFT_EPHEMERAL', filter_var($ephemeral, FILTER_VALIDATE_BOOL));
}

// Load and run Craft
$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php';
$app->run();

0 comments on commit 0efca07

Please sign in to comment.