xp-framework / core

The XP Framework is an all-purpose, object oriented PHP framework.
Other
19 stars 6 forks source link

Environment::variables() empty on certain environments #265

Closed thekid closed 3 years ago

thekid commented 3 years ago
thekid@Surface:~$ export | wc -l
22
thekid@Surface:~$ xp -w '\lang\Environment::variables()'
[]

This is because the ini setting variables_order doesn't include E for populating the $_ENV global:

thekid@Surface:~$ php -i | grep ini | head -1
Configuration File (php.ini) Path => /etc/php/7.4/cli
thekid@Surface:~$ grep -Er 'variables_order\s*=' /etc/php/7.4/cli
/etc/php/7.4/cli/php.ini:variables_order = "GPCS"

See also https://www.php.net/manual/de/ini.core.php#ini.variables-order. First noticed when running https://github.com/xp-framework/core/actions/runs/670703578