Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit dd4807b

Browse files
authored
Merge pull request #1 from platformsh/app-env
Set a default APP_ENV.
2 parents 646cc06 + f55cdce commit dd4807b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

platformsh-flex-env.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,11 @@ function mapPlatformShEnvironment() : void
4646
if (!getenv('APP_SECRET') && getenv('PLATFORM_PROJECT_ENTROPY')) {
4747
putenv('APP_SECRET=' . getenv('PLATFORM_PROJECT_ENTROPY'));
4848
}
49+
50+
// Default to production. You can override this value by setting
51+
// `env:APP_ENV` as a project variable, or by adding it to the
52+
// .platform.app.yaml variables block.
53+
if (!getenv('APP_ENV')) {
54+
putenv('APP_ENV=prod');
55+
}
4956
}

0 commit comments

Comments
 (0)