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

Commit 9626562

Browse files
committed
Switch back to getenv() for reading Platform.sh values, as it's the only option that is populated when running in the PHP built in web server.
1 parent e62a774 commit 9626562

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platformsh-flex-env.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ function mapPlatformShDatabase() : void
4242

4343
// Set the DATABASE_URL for Doctrine, if necessary.
4444
# "mysql://[email protected]:3306/symfony?charset=utf8mb4&serverVersion=5.7";
45-
if (isset($_SERVER['PLATFORM_RELATIONSHIPS'])) {
46-
$relationships = json_decode(base64_decode($_SERVER['PLATFORM_RELATIONSHIPS']), true);
45+
if (getenv('PLATFORM_RELATIONSHIPS')) {
46+
$relationships = json_decode(base64_decode(getenv('PLATFORM_RELATIONSHIPS'), true));
4747
foreach ($relationships[$dbRelationshipName] as $endpoint) {
4848
if (empty($endpoint['query']['is_master'])) {
4949
continue;

0 commit comments

Comments
 (0)