Skip to content

Conversation

@mike-marshall0164
Copy link

This should slighyl improve this hack by allowing us to utilize the environment vars we'll be setting for the EB containers, as well as maintaining backwards compatibility with the existing method of pulling in the hard coded file parameters.yml

'database_host' => $_SERVER['SYMFONY__DB__HOST'],
'database_user' => $_SERVER['SYMFONY__DB__USER'],
'database_password' => $_SERVER['SYMFONY__DB__PASSWORD'],
'database_name' => $_SERVER['APPLICATOIN_ENV'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here

$file = file_get_contents($documentRoot.'/app/config/parameters.yml');
$configParams = Yaml::parse($file);
// load db configuration, NOTE: This is a hack! (made hackier by Mike M)
if(isset($_SERVER['SYMFONY__DB__HOST']) && isset($_SERVER['SYMFONY__DB__USER']) && isset($_SERVER['SYMFONY__DB__PASSWORD']) && isset($_SERVER['APPLICATOIN_ENV']) && isset($_SERVER['SYMFONY__SAML__KEY__PASS'])) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here in APPLICATION_ENV

$file = file_get_contents($documentRoot.'/app/config/parameters.yml');
$configParams = Yaml::parse($file);
// load db configuration, NOTE: This is a hack! (made hackier by Mike M)
if(isset($_SERVER['SYMFONY__DB__HOST']) && isset($_SERVER['SYMFONY__DB__USER']) && isset($_SERVER['SYMFONY__DB__PASSWORD']) && isset($_SERVER['APPLICATOIN_ENV']) && isset($_SERVER['SYMFONY__SAML__KEY__PASS'])) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isset() can take multiple arguments and will only return true if all of the arguments are set, it can shorten the line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants