Review main Merged

65032[FEATURE] Allow system maintainer to mute disable_functions error

Albrecht Köhnlein CR +2 V +2 Normal +95 −10 updated 06/28/24, 22:04

Commit message

Add a configuration option to customize the environment check in the
Install Tool for a list of `disable_functions` which are then reported
as warning instead of error.

With this new configuration option, a system maintainer is able to add
function names to this list. Thus, the Install Tool and monitoring
systems based on the environment check will not trigger errors for
these functions anymore. Since a warning will still be emitted,
the fact of a "special configuration" itself will not be lost.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Jochen Roth +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Jochen Roth +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 6693

Show 4668 earlier messages
  1. Albrecht Köhnlein uploaded patch set 1 07/11/20, 18:20

  2. TYPO3com voted on patch set 1 V +1 07/11/20, 18:34 Completed build in 13m 57s on Sat, 11 Jul, 06:34 PM Test Summary: 72863 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4070

  3. Josef Glatz commented on patch set 2 07/15/20, 05:36

    Published edit on patch set 1.
  4. Josef Glatz commented on patch set 2 V -1 07/15/20, 05:38

    I think features are only for the master afair
  5. TYPO3com voted on patch set 2 V +1 07/15/20, 05:47 Completed build in 10m 44s on Wed, 15 Jul, 05:47 AM Test Summary: 72863 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4098

  6. Albrecht Köhnlein uploaded patch set 3 07/15/20, 06:33

  7. Albrecht Köhnlein uploaded patch set 4 07/15/20, 06:35

  8. Albrecht Köhnlein commented on patch set 4 07/15/20, 06:38

    > Patch Set 2: Verified-1 > > (1 comment)

    Reply

    Ok, I think you're right and I removed 10.4. Although I personally would need this feature in one of my TYPO3 10 projects, but I can handle it another way. :)
  9. TYPO3com voted on patch set 3 V +1 07/15/20, 06:45 Completed build in 12m 38s on Wed, 15 Jul, 06:45 AM Test Summary: 72862 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4099

  10. TYPO3com voted on patch set 4 V +1 07/15/20, 06:49 Completed build in 13m 33s on Wed, 15 Jul, 06:49 AM Test Summary: 72863 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4100

  11. Jörg Bösche commented on patch set 4 CR -1 09/02/20, 08:33

    Missing RST file for this feature.
  12. Jörg Bösche uploaded patch set 5 09/07/20, 09:00

  13. TYPO3com voted on patch set 5 V +1 09/07/20, 09:11 Completed build in 11m 08s on Mon, 7 Sep, 09:11 AM Test Summary: 73227 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5313

  14. Oli Bartsch commented on patch set 5 CR -1 09/07/20, 09:15

    RST is somehow broken. Will have a look.
  15. Oli Bartsch uploaded patch set 6 09/07/20, 09:30

  16. TYPO3com voted on patch set 6 V +1 09/07/20, 09:45 Completed build in 13m 38s on Mon, 7 Sep, 09:45 AM Test Summary: 73227 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5317

  17. Jörg Bösche voted on patch set 6 CR +1 09/07/20, 09:55

  18. Albrecht Köhnlein uploaded patch set 7 11/16/21, 20:11

  19. Albrecht Köhnlein uploaded patch set 8 11/16/21, 20:24

  20. core-ci voted on patch set 7 V -1 11/16/21, 20:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19372

  21. core-ci voted on patch set 8 V -1 11/16/21, 20:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19374

  22. Albrecht Köhnlein uploaded patch set 9 11/16/21, 20:28

  23. Albrecht Köhnlein uploaded patch set 10 11/16/21, 20:30

  24. core-ci voted on patch set 9 V -1 11/16/21, 20:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19375

  25. Albrecht Köhnlein updated the commit message in patch set 11 11/16/21, 20:46

  26. core-ci voted on patch set 10 V +1 11/16/21, 20:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19376

  27. core-ci voted on patch set 11 V +1 11/16/21, 21:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19379

  28. Benni Mack wrote 11/29/21, 10:13

    Change destination moved from master to main
  29. Benni Mack updated the commit message in patch set 12 11/29/21, 13:37

  30. Albrecht Köhnlein commented on patch set 12 11/29/21, 17:19

    By the way ... what would be the correct path for the RST file? At the moment, it's `master` too. Should it be changed to `main` or to `12.0` or something completly different?
  31. Benni Mack commented on patch set 12 04/14/23, 10:04

    The feature should go into 12.4 (or 13.0 as we have feature freeze now)
  32. Chris Müller commented on patch set 12 09/26/23, 17:25

    Reply

    Currently, it would be "13.0".
  33. Georg Ringer commented on patch set 12 09/26/23, 21:50

    Feature-91783-AddAllowListForPhpiniSettingDisable_functions.rst:14

    currently
  34. Garvin Hicking commented on patch set 12 V +1 CR +1 10/11/23, 15:48

    Thanks for this contribution. This has just recently affected an installation of mine, and for a "tidy environment check" it would be really nice to filter this. I made some suggestions on wording, maybe they can be helpful. I'd love if this could be updated to be included in v13 main.

    DefaultConfigurationDescription.yaml:222

    I wonder if that can be more precise; people may read the config name to be related to "functions of TYPO3". So maybe: "allowedPhpDisableFunctions"?

    DefaultConfigurationDescription.yaml:224

    technically it would be "hosting provider's", but you could also host it yourself, so... I'd suggest to strike it all together and just reference "your php.ini".

    Feature-91783-AddAllowListForPhpiniSettingDisable_functions.rst:14 Reply

    Or "irrelevant to this installation"?

    Feature-91783-AddAllowListForPhpiniSettingDisable_functions.rst:16

    For v12 and up refer to `:file:config/system/settings.php`?

    Check.php:410

    Use the chance and rephrase this to "often"?

    Check.php:424

    "function"

    Check.php:426

    strip this, see above

    Check.php:430

    "Notice for known irrelevant functions (e.g. pcntl_*)"
  35. Benni Mack wrote 01/30/24, 14:29

    Removed cc Benni Mack.
  36. Garvin Hicking commented on patch set 12 04/05/24, 13:07

    Hi @ak@koehnlein.eu - I hope my initial remarks some time ago didn't push you off. I do think this patch would be very nice to have, maybe we can work on it together if you like? (Feel free to hit me up on Slack)
  37. Albrecht Köhnlein commented on patch set 12 04/06/24, 15:33

    Reply

    Thanks for sending some motivation. I will continue my work the next days 😊
  38. Albrecht Köhnlein uploaded patch set 13 CR +1 V +1 04/06/24, 17:34

  39. Albrecht Köhnlein uploaded patch set 14 04/06/24, 17:41

  40. core-ci voted on patch set 13 V -1 04/06/24, 17:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55450

  41. Albrecht Köhnlein commented on patch set 14 04/06/24, 17:42

    DefaultConfigurationDescription.yaml:222 Reply

    Changed

    Check.php:410 Reply

    Changed

    Check.php:424 Reply

    Changed

    Check.php:426 Reply

    Changed

    Check.php:430 Reply

    Changed
  42. Albrecht Köhnlein commented on patch set 14 04/06/24, 17:43

    DefaultConfigurationDescription.yaml:224 Reply

    Changed
  43. core-ci voted on patch set 14 V -1 04/06/24, 17:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55451

  44. Albrecht Köhnlein uploaded patch set 15 V -1 04/06/24, 17:52

  45. Albrecht Köhnlein uploaded patch set 16 04/06/24, 17:55

  46. core-ci voted on patch set 15 V -1 04/06/24, 17:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55452

  47. core-ci voted on patch set 16 V -1 04/06/24, 18:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55453

  48. Albrecht Köhnlein uploaded patch set 17 V -1 04/06/24, 18:08

  49. core-ci voted on patch set 17 V +1 04/06/24, 18:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55454

  50. Albrecht Köhnlein uploaded patch set 18 V +1 04/07/24, 16:20

  51. Albrecht Köhnlein commented on patch set 17 04/07/24, 16:22

    Reply

    Done

    Feature-91783-AddAllowListForPhpiniSettingDisable_functions.rst:14 Reply

    Thanks. I fixed the typo

    Feature-91783-AddAllowListForPhpiniSettingDisable_functions.rst:16 Reply

    Just realized, this still was open. I only used the new file name but not the full path. To be honest, I do not even know exactly, if the path is the same for non-composer installations.
  52. core-ci voted on patch set 18 V +1 04/07/24, 16:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55515

  53. Garvin Hicking uploaded patch set 19 V +1 04/08/24, 13:21

    Some minor rephrasing
  54. Garvin Hicking commented on patch set 19 CR +1 V +1 04/08/24, 13:23

    Thanks a lot for picking this up again. I took the liberty to change the wording in some minor aspects. I tested it again and works nicely for me!

    Feature-91783-AddAllowListForPhpiniSettingDisable_functions.rst:16 Reply

    Done
  55. core-ci voted on patch set 19 V +1 04/08/24, 13:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55562

  56. Albrecht Köhnlein uploaded patch set 20 CR +1 V +1 04/24/24, 09:22

  57. core-ci voted on patch set 20 V +1 04/24/24, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56645

  58. Garvin Hicking voted on patch set 20 CR +1 V +1 04/24/24, 09:31

  59. Stephan Großberndt commented on patch set 21 CR +1 V +1 04/24/24, 09:56

    Published edit on patch set 20.
  60. core-ci voted on patch set 21 V +1 04/24/24, 10:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56646

  61. Stephan Großberndt updated the commit message in patch set 22 V +1 04/24/24, 10:01

  62. Stephan Großberndt uploaded patch set 23 04/24/24, 10:08

  63. core-ci voted on patch set 22 V +1 04/24/24, 10:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56648

  64. Stephan Großberndt voted on patch set 23 CR +1 04/24/24, 10:09

  65. core-ci voted on patch set 23 V +1 04/24/24, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56649

  66. Garvin Hicking voted on patch set 23 CR +1 V +1 04/24/24, 10:14

  67. Stephan Großberndt uploaded patch set 24 CR +1 V +1 04/24/24, 10:16

  68. Stephan Großberndt uploaded patch set 25 04/24/24, 10:21

  1. core-ci voted on patch set 24 V +1 04/24/24, 10:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56651

  2. core-ci voted on patch set 25 V +1 04/24/24, 10:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56652

  3. Stephan Großberndt voted on patch set 25 CR +1 V +1 04/24/24, 10:37

  4. Garvin Hicking voted on patch set 25 CR +1 V +1 04/24/24, 11:50

  5. Georg Ringer commented on patch set 25 04/24/24, 18:04

    Feature-91783-AllowSystemMaintainerToMuteDisableFunctionsError.rst:15

    we call it "Install Tool"
  6. Albrecht Köhnlein uploaded patch set 26 CR +1 V +1 04/24/24, 19:33

  7. Albrecht Köhnlein commented on patch set 26 04/24/24, 19:34

    Feature-91783-AllowSystemMaintainerToMuteDisableFunctionsError.rst:15 Reply

    Changed it
  8. core-ci voted on patch set 26 V +1 04/24/24, 19:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56666

  9. Stefan Bürk commented on patch set 26 CR -1 04/24/24, 20:55

    on it ...
  10. Stefan Bürk voted on patch set 26 CR 0 05/06/24, 06:54

  11. Garvin Hicking commented on patch set 26 CR +1 V +1 05/08/24, 22:04

    Stefan, if you remember what you wanted to address here, let me know and we'll work it out. Really hope we can get this off the ground 🥹

    Feature-91783-AllowSystemMaintainerToMuteDisableFunctionsError.rst:15 Reply

    Done
  12. André Buchmann voted on patch set 26 CR +1 05/29/24, 10:53

  13. Benjamin Franzke commented on patch set 26 CR -1 06/03/24, 06:23

    DefaultConfigurationDescription.yaml:166

    This should be `type: array`
  14. Garvin Hicking uploaded patch set 27 CR +1 V +1 06/03/24, 18:28

    Change config option to array
  15. Garvin Hicking commented on patch set 27 CR +1 V +1 06/03/24, 18:58

    DefaultConfigurationDescription.yaml:166 Reply

    Good suggestion, I've changed this to an array know. @ak@koehnlein.eu - hope it was ok to rush ahead with this change - I'd really like this for our installations reporting false positives :)
  16. core-ci voted on patch set 27 V +1 06/03/24, 19:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58632

  17. Jochen Roth voted on patch set 27 CR +1 V +1 06/13/24, 12:56

  18. Stefan Bürk commented on patch set 27 CR -1 06/13/24, 15:19

    Feature-91783-AllowSystemMaintainerToMuteDisableFunctionsError.rst:26

    That's the structure in a `additional.php`. For `settings.php` this would be more like: ```php <?php return [ 'SYS' => [ 'allowedPhpDisableFunctions' => [ 'set_time_limit', 'set_file_buffer', ], // ... ], // ... ]; ```

    Check.php:376

    I would chop this tenary down so it is "readable" in one-go without having to read to much from left to right (and avoid a extreme long line) - and no need for using `()` around the full statement here. Using `()` should be done on the tenary condition if it has multiple parts. ```php $configuredAllowedDisableFunctions = is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['allowedPhpDisableFunctions']) ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['allowedPhpDisableFunctions'] : [] ; ``` What do you think to further simplify this here: ```php $configuredAllowedDisableFunctions = $GLOBALS['TYPO3_CONF_VARS']['SYS']['allowedPhpDisableFunctions'] ?? []; if (!is_array($configuredAllowedDisableFunctions)) { $configuredAllowedDisableFunctions = []; } ```

    Check.php:380

    I would reverse the check to move the foreach with a continue up and having the simple unset without a else block here to reduce the load a bit (or using continue for the simple unset and moving the foreach out of the else block. **Either this one ...** ```php foreach ($disabledFunctionsArray as $key => $disabledFunction) { if (in_array($disabledFunction, $configuredAllowedDisableFunctions, true)) { unset($disabledFunctionsArray[$key]); $foundAllowedDisableFunctions[] = $disabledFunction; continue; } foreach ($findStrings as $findString) { if (str_contains($disabledFunction, $findString)) { unset($disabledFunctionsArray[$key]); } } } ``` **... or this one** ```php foreach ($disabledFunctionsArray as $key => $disabledFunction) { if (in_array($disabledFunction, $configuredAllowedDisableFunctions, true)) { foreach ($findStrings as $findString) { if (str_contains($disabledFunction, $findString)) { unset($disabledFunctionsArray[$key]); } } continue; } unset($disabledFunctionsArray[$key]); $foundAllowedDisableFunctions[] = $disabledFunction; } ```
  19. Garvin Hicking uploaded patch set 28 CR +1 V +1 06/14/24, 07:16

    Apply code review suggestions
  20. Garvin Hicking commented on patch set 28 06/14/24, 07:17

    Thanks for the feedback, Stefan. I've conferred with Albrecht and he gave me the go-ahead to adjust this, I think these were good improvements.

    Feature-91783-AllowSystemMaintainerToMuteDisableFunctionsError.rst:26 Reply

    Good catch. Adjusted and described all three ways (additional, settings, gui)

    Check.php:376 Reply

    Sure! I think the latter version is fine.

    Check.php:380 Reply

    I think the first one is better to parse, thanks for the suggestion.
  21. Garvin Hicking voted on patch set 28 CR +1 V +1 06/14/24, 07:17

  22. core-ci voted on patch set 28 V +1 06/14/24, 07:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59574

  23. Jochen Roth voted on patch set 28 CR +1 V +1 06/14/24, 07:34

  24. Stefan Bürk voted on patch set 28 CR +2 V +2 06/28/24, 22:04

  25. Stefan Bürk merged patch set 29 06/28/24, 22:04