Review main Merged

63053[TASK] Check valid database name specific for DBMS

Manuel Selbach CR +2 V +2 Normal +114 −2 updated 12/20/21, 21:48

Commit message

With this change the check for a valid database name will be done
specific for each DBMS.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Susi Moog +1
  • Verified V +2 Done
    • Benni Mack +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 4

Review log 3545

Show 1520 earlier messages
  1. Manuel Selbach uploaded patch set 1 01/27/20, 21:56

  2. TYPO3com voted on patch set 1 V +1 01/27/20, 22:07 Completed build in 11m 01s on Mon, 27 Jan, 10:07 PM Test Summary: 70600 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40288

  3. Oliver Klee commented on patch set 1 01/27/20, 23:52

    AbstractPlatform.php:36

    Any particular reason you are not using a constant here?
  4. Manuel Selbach uploaded patch set 2 02/05/20, 08:55

  5. Manuel Selbach uploaded patch set 3 02/11/20, 22:01

  6. Manuel Selbach commented on patch set 3 02/11/20, 22:03

    This change is ready for review.

    AbstractPlatform.php:36 Reply Unresolved

    Thanks for the first feedback. I'm still working on this patch, but yes, it should be possible to overwrite the value in the actual classes, see the other patchsets :)
  7. Oliver Klee commented on patch set 3 02/11/20, 22:15

    I've just tested that constants can be overwritten in subclasses.
  8. Manuel Selbach uploaded patch set 4 02/12/20, 10:40

  9. Manuel Selbach commented on patch set 4 02/12/20, 10:41

    > Patch Set 3: > > I've just tested that constants can be overwritten in subclasses. Thanks again for checking. I changed it, but scoping is a thing that should be kept in mind ;) If you would use self:: instead of static::, you would get the parent value.
  10. TYPO3com voted on patch set 4 V -1 02/12/20, 12:58 Completed build in 13m 44s on Wed, 12 Feb, 12:58 PM Test Summary: 71262 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-13

  11. TYPO3com commented on patch set 4 02/17/20, 20:06 Completed build in 13m 42s on Mon, 17 Feb, 08:06 PM Test Summary: 71295 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-221

  12. Manuel Selbach uploaded patch set 5 02/17/20, 20:44

  13. TYPO3com voted on patch set 5 V +1 02/17/20, 21:10 Completed build in 18m 42s on Mon, 17 Feb, 09:10 PM Test Summary: 71295 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-224

  14. Stefan Froemken commented on patch set 5 CR -1 02/17/20, 22:30

    SqlSrv.php:185

    PostGre?
  15. Manuel Selbach commented on patch set 5 02/17/20, 22:36

    SqlSrv.php:185 Reply Unresolved

    Yes, right, some copy / paste issue. I will adapt the whole message. Thanks for finding that one.
  16. Manuel Selbach uploaded patch set 6 02/17/20, 22:59

  17. TYPO3com voted on patch set 6 V +1 02/17/20, 23:31 Completed build in 24m 34s on Mon, 17 Feb, 11:31 PM Test Summary: 71338 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-234

  18. Oliver Klee commented on patch set 6 02/17/20, 23:44

    AbstractPlatform.php:66 Unresolved

    If the const is the maximum length, shouldn't that be <= instead of < for valid lengths?
  19. Manuel Selbach uploaded patch set 7 02/18/20, 08:03

  20. Manuel Selbach commented on patch set 7 02/18/20, 08:05

    > Patch Set 6: > > (1 comment) Thanks for the hint, you're right! I adapted it also for the other specific checks
  1. TYPO3com voted on patch set 7 V +1 02/18/20, 08:17 Completed build in 13m 19s on Tue, 18 Feb, 08:17 AM Test Summary: 71338 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-235

  2. Daniel Siepmann commented on patch set 7 V -1 CR -1 02/20/20, 09:35

    Sqlite.php:82

    Results in the following error: > (1/1) TypeError > > Return value of TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck\Platform\Sqlite::isValidDatabaseName() must be of the type bool, int returned as preg_match may return an int and "strict_types" is set. https://www.php.net/manual/en/function.preg-match.php > preg_match() returns 1 if the pattern matches given subject, 0 if it does not, or FALSE if an error occurred.
  3. Manuel Selbach rebased onto patch set 8 02/20/20, 13:50

  4. Manuel Selbach uploaded patch set 9 02/20/20, 13:52

  5. Daniel Siepmann commented on patch set 9 V +1 02/20/20, 13:56

    Tested with sqlite, not tested with all others.
  6. Daniel Siepmann commented on patch set 9 02/20/20, 13:57

    Sqlite.php:82 Reply

    Done
  7. TYPO3com voted on patch set 8 V +1 02/20/20, 14:37 Completed build in 36m 16s on Thu, 20 Feb, 02:37 PM Test Summary: 71464 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-343

  8. TYPO3com voted on patch set 9 V +1 02/20/20, 14:47 Completed build in 46m 34s on Thu, 20 Feb, 02:47 PM Test Summary: 71464 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-344

  9. Susi Moog voted on patch set 9 CR +1 02/22/20, 17:20

  10. Susi Moog commented on patch set 9 V +1 02/22/20, 17:24

    tested sqlite and mysql
  11. Susi Moog rebased onto patch set 10 02/28/20, 06:21

  12. Susi Moog commented on patch set 10 02/28/20, 06:21

    (rebased to get phpstan results ;))
  13. TYPO3com voted on patch set 10 V +1 02/28/20, 06:33 Completed build in 12m 20s on Fri, 28 Feb, 06:33 AM Test Summary: 72003 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-761

  14. Susi Moog voted on patch set 10 V +1 CR +1 02/28/20, 06:37

  15. Markus Klein commented on patch set 10 CR -1 02/28/20, 08:31

    AbstractPlatform.php:66

    AFAIK late static binding for const does not work.
  16. Susi Moog commented on patch set 10 02/28/20, 08:40

    AbstractPlatform.php:66 Reply Unresolved

  17. Andreas Kienast commented on patch set 10 02/28/20, 08:53

    AbstractPlatform.php:77

    "must be shorter than" should be rephrased, as "equals to" would still be fine. What about "The given database name must not be longer than..."?
  18. Susi Moog commented on patch set 10 02/28/20, 09:01

    AbstractPlatform.php:77 Reply Unresolved

    go ahead, sounds good I'd say.
  19. Andreas Kienast uploaded patch set 11 02/28/20, 09:20

  20. TYPO3com voted on patch set 11 V +1 02/28/20, 09:30 Completed build in 10m 36s on Fri, 28 Feb, 09:30 AM Test Summary: 72051 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-777

  21. Susi Moog voted on patch set 11 V +1 CR +1 02/28/20, 09:44

  22. Benni Mack voted on patch set 11 V +2 CR +2 03/01/20, 19:09

  23. Benni Mack merged patch set 12 03/01/20, 19:09

  24. Alexander Schnitzler commented on patch set 12 03/01/20, 20:47

    AbstractPlatform.php:36 Unresolved

    This is a bit of a nitpick but I would suggest not to use class constants like this directly as api but use an interface method instead. This makes the need for this mandatory length more visible and follows a clean oop approach. Constants can still be used but it should be encapsulated in an interface method which ensures type safety as long as we don't have type safe constants in php.
  25. Markus Klein commented on patch set 12 12/20/21, 21:48

    Sqlite.php:82 Unresolved

    Frankly the Core itself generates invalid names... `$dbFilename = '/cms-' . (new Random())->generateRandomHexString(8) . '.sqlite';` https://forge.typo3.org/issues/96406