Review main Merged

57115[FEATURE] Add getEnv value modifier to TS parser

Felix Althaus CR +2 V +2 Normal +113 −1 updated 07/18/18, 17:46

Commit message

Use :=getEnv() in TypoScript to read values from environment variables.

Review

  • Code review CR +2
    • Andreas Wolf +2
    • Hannes Lau +1
    • Andreas Kienast +1
    • Jörg Bösche +1
  • Verified V +2
    • Andreas Wolf +2
    • Hannes Lau +1
    • Jörg Bösche +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 1316

  1. Felix Althaus uploaded patch set 1 06/03/18, 14:16

  2. TYPO3com voted on patch set 1 V +1 06/03/18, 14:23 Completed build in 06m 57s on Sun, 3 Jun, 04:23 PM Test Summary: 31159 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24008

  3. Felix Althaus uploaded patch set 2 06/03/18, 14:37

  4. TYPO3com voted on patch set 2 V +1 06/03/18, 14:44 Completed build in 06m 49s on Sun, 3 Jun, 04:44 PM Test Summary: 31159 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24009

  5. Benni Mack commented on patch set 2 06/03/18, 18:03

    Hey felix, you know that you can do this already via 10 = TEXT 10.data = env:FOO ?
  6. Felix Althaus commented on patch set 2 06/03/18, 18:57

    > 10.data = env:FOO Hi Benni, yes I know that feature. It has three downsides, though, which are addressed by this patch: * It‘s only available in setup. If you use one constant all over the place you‘ll have to fix each an every occurrence * It adds load (as it is evaluated at run time) as opposed to parse time * You‘ll need stdWrap (or data type gettext, to be precise). This is just not the case everywhere https://github.com/helhum/env-ts addresses basically the same issues.
  7. Felix Althaus uploaded patch set 3 06/03/18, 22:54

  8. TYPO3com voted on patch set 3 V +1 06/03/18, 23:02 Completed build in 07m 14s on Mon, 4 Jun, 01:02 AM Test Summary: 31161 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24014

  9. Benni Mack commented on patch set 3 06/04/18, 07:56

    OK. gotcha. could you please rename this modifier to just "env()" then? seems to be more in line with PHP's native "env()" logic. apart from that - fine with me :)
  10. Felix Althaus commented on patch set 3 06/04/18, 08:51

    > could you please rename this modifier to just "env()" > then? seems to be more in line with PHP's native "env()" logic. I can‘t find any function named `env()` in PHP. I‘m using `getenv()` (http://php.net/manual/en/function.getenv.php), hence the naming of the modifier. Can you point me to `env()`?
  11. Felix Althaus commented on patch set 3 06/04/18, 09:09

    There‘s one more question that arose while rereading getenv() documentation: Should I follow the third example http://php.net/manual/en/function.getenv.php#example-539 to make the modifier more bullet-proof? But that would be inconsistent with e.g. https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php#l454 …
  12. Hannes Lau commented on patch set 3 V +1 CR +1 06/22/18, 21:38

    Works fine for me. I would also stay with getEnv or maybe switch to getenv. Regarding the second parameter of the getenv function, I would leave it as is, as this is the expected default behavior of getenv.
  13. Jörg Bösche voted on patch set 3 V +1 CR +1 06/27/18, 06:46

  14. Andreas Kienast voted on patch set 3 CR +1 06/27/18, 08:12

  15. Andreas Wolf voted on patch set 3 V +2 CR +2 07/18/18, 17:46

  16. Andreas Wolf merged patch set 4 07/18/18, 17:46