Review main Merged

60646[BUGFIX] Skip mkdir on logfiles with wrapper

Sven Carstens CR +2 V +2 Easy +13 −7 updated 01/15/20, 13:37

Commit message

Check for wrapper usage via parse_url before creating the
directories for the logfile. Only "none", "file" and "vfs"
get passed on to mkdir - if the file:// wrapper is used
remove that before creating the directory hierarchy.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Markus Klein +1
    • Daniel Siepmann +1
    • Jörg Bösche +1
  • Verified V +2 Done
    • Benni Mack +2
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 2125

  1. Sven Carstens uploaded patch set 1 05/03/19, 06:17

  2. TYPO3com voted on patch set 1 V -1 05/03/19, 06:17 Completed build in 06s on Fri, 3 May, 08:17 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33699

  3. Andreas Kienast uploaded patch set 2 05/03/19, 06:49

  4. TYPO3com voted on patch set 2 V +1 05/03/19, 06:59 Completed build in 10m 40s on Fri, 3 May, 08:59 AM Test Summary: 47475 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33700

  5. Markus Klein commented on patch set 2 05/03/19, 07:05

    FileWriter.php:227

    can mkdir_deep deal with VFS?
  6. Stephan Großberndt updated the commit message in patch set 3 05/03/19, 07:14

  7. Mathias Brodala commented on patch set 3 05/03/19, 07:16

    FileWriter.php:227 Reply

    Should work since in the end it's just a bunch of plain "mkdir()" calls.
  8. Mathias Brodala commented on patch set 3 05/03/19, 07:17

    FileWriter.php:223

    This should be in_array()
  9. TYPO3com voted on patch set 3 V +1 05/03/19, 07:24 Completed build in 09m 50s on Fri, 3 May, 09:24 AM Test Summary: 47475 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33702

  10. Markus Klein commented on patch set 3 05/03/19, 07:50

    FileWriter.php:223 Reply

    No it should not be in_array! It is way slower to create an array and run a search function on it than just comparing 3 times (which will abort once the first match is hit). On top we have different data types, which makes it slower again with in_array. There have been cleanups in the past, that specifically changed those in_array stuff with 3 or 4 elements to plain comparision.
  11. Mathias Brodala commented on patch set 3 05/03/19, 08:29

    FileWriter.php:223 Reply

    Well, the array could be constructed once and used many times. But I won't argue about this.
  12. Sven Carstens commented on patch set 3 05/03/19, 11:38

    > Patch Set 3: > > (1 comment)

    FileWriter.php:227 Reply

    At first I didn't put in the vfs as an exception. Then the tests on bamboo failed while writing to the vfs: logs.
  13. Susi Moog voted on patch set 3 CR +1 12/20/19, 08:01

  14. Jonas Eberle commented on patch set 3 12/23/19, 10:19

    I like the change (stdout and stderr are useful especially in containers) but I do not understand how file:// can end up here. It is "logFile" here https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Logging/Configuration/Index.html, isn't it? I wouldn't even expect php://stdout to be legal here (should go to the docs the, too) or am I missing something?

    FileWriter.php:221 Unresolved

    this should say ... but file://, vfs:// or empty or else the condition below looks erroneous

    FileWriter.php:223

    What's vfs? Is it a custom value used in testing? I couldn't make sense of it, maybe add a comment why it needs directories created?
  15. Markus Klein commented on patch set 3 01/12/20, 15:46

    FileWriter.php:223 Reply Unresolved

    yes vfs is used for tests and is_dir() is working on that stream
  16. Markus Klein uploaded patch set 4 01/12/20, 15:47

  17. Markus Klein voted on patch set 4 V +1 CR +1 01/12/20, 15:49

  18. TYPO3com voted on patch set 4 V +1 01/12/20, 15:56 Completed build in 09m 23s on Sun, 12 Jan, 03:56 PM Test Summary: 69203 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39825

  19. Jörg Bösche voted on patch set 4 CR +1 01/13/20, 11:07

  20. Daniel Siepmann commented on patch set 4 01/14/20, 06:53

    FileWriter.php:222

    I guess it would be easier to read and maintain if we use `in_array` and create an array like `$allowedSchemes`.
  21. Daniel Siepmann commented on patch set 4 CR +1 01/14/20, 06:55

    FileWriter.php:222 Reply

    Sorry, didn't see the older comments. Ignore this idea as this was already discussed.
  22. Benni Mack voted on patch set 4 V +2 CR +2 01/14/20, 13:45

  23. Benni Mack merged patch set 5 01/14/20, 13:45

  24. Susi Moog commented on patch set 5 01/15/20, 12:53

    -1 this now results in windows not being able to create the log file as the directory does not get created. For example: Log file is configured as path 'D:/CoreDev/comp/Packages/TYPO3.CMS/typo3temp/var/log/typo3_234423.log' (default log file name) - scheme is now "D".
  25. Sven Carstens commented on patch set 5 01/15/20, 13:37

    > Patch Set 5: > > -1 this now results in windows not being able to create the log file as the directory does not get created. > > For example: Log file is configured as path 'D:/CoreDev/comp/Packages/TYPO3.CMS/typo3temp/var/log/typo3_234423.log' (default log file name) - scheme is now "D". Maybe we should change the logic to only skip mkdir when the scheme is 'php' ?