zendframework / zend-console

Console component from Zend Framework
BSD 3-Clause "New" or "Revised" License
48 stars 31 forks source link

$_ENV is not enabled by default, $_SERVER should be used #18

Open jaapio opened 8 years ago

jaapio commented 8 years ago

Ubuntu has a default setting which only stores the environment variables in $_SERVER. The $_ENV is always empty, only when variables_order is changed to EGPCS $_ENV is available.

Quote from the php.ini:

; This directive determines which super global arrays are registered when PHP ; starts up. G,P,C,E & S are abbreviations for the following respective super ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty ; paid for the registration of these arrays and because ENV is not as commonly ; used as the others, ENV is not recommended on productions servers. You ; can still get access to the environment variables through getenv() should you ; need to.

Therefore I think zend-console should use $_SERVER instead of $_ENV

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-console; a new issue has been opened at https://github.com/laminas/laminas-console/issues/8.