Skip to content

getenv() values missing from EnvironmentVariable::getEnvironmentVariables() #10

@karlwilbur

Description

@karlwilbur

Using Environment::get(), one can obtain variables not included in Environment::getAll(). This odd behavior is caused by EnvironmentVariable::getEnvironmentVariables() searching only $_ENV and $_SERVER, whereas EnvironmentVariable::getEnvironmentVariable() searches $_ENV, $_SERVER, and getenv().

I suggest including a call to getenv() inside of EnvironmentVariable::getEnvironmentVariables() for the purpose of pulling in any variables that may not be included in $_ENV (such as when variables_order is set to "GPCS" thus excluding $_ENV).

I am going to make this code change and submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions