90786[TASK] Streamline `SchemaInformation` cache handling
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Benjamin Franzke +1
- Christian Kuhn +1
-
Verified V +2 Done
- Stefan Bürk +2
- Benjamin Franzke +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 5
Files 9
- typo3/sysext/core/Classes/Database/Schema/Information/ColumnInfo.php6new+80 −0
- typo3/sysext/core/Classes/Database/Schema/Information/TableInfo.php2new+64 −0
- typo3/sysext/core/Classes/Database/Schema/SchemaInformation.php6+64 −40
- typo3/sysext/core/Classes/Database/Connection.php+7 −5
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+2 −2
- typo3/sysext/core/Classes/Utility/RootlineUtility.php+4 −7
- typo3/sysext/core/Tests/Functional/Database/Schema/SchemaMigratorTest.php+53 −9
- typo3/sysext/install/Classes/Service/SetupService.php+1 −1
- typo3/sysext/redirects/Classes/Service/SlugService.php+6 −7
Review log 2434
Show 69 earlier messages
-
Stefan Bürk uploaded patch set 1 09/24/25, 14:17
-
core-ci voted on patch set 1 V +1 09/24/25, 14:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85450
-
Stefan Bürk uploaded patch set 2
V +109/24/25, 15:21 -
core-ci voted on patch set 2 V +1 09/24/25, 15:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85455
-
Benjamin Franzke commented on patch set 2 09/25/25, 12:17
I think this simplification is a good way to solve the issue and implementation looks good so far. Feel free to finish the patch. :)I think we should ideally implement one (un)serialization method serialize or __set_state. I personally prefer __set_state because it created PHP that can just be required and opcached, but you can keep serialize as well. If you stick with one, let's remove the other, do avoid dead code.TableInfo.php:47I'd prefer to trust the cache and avoid sanitization in the constructor. … use `PackageDependentCacheIdentifier` in the cache lookup, which helps ensure that caches are refreshed on every system change (update/extension install).SchemaInformation.php:47Let's use `PackageDependentCacheIdentifier` to create a version that is unique per typo3 version/set-of-installed-extensions, which helps ensure that caches are refreshed on every system change and avoids custom version numbers that we need to update manually in here. (The serialization of the connection params can actually be passed as additional hashing information to `PackageDependentCacheIdentifier`) -
Stefan Bürk uploaded patch set 3
V +109/26/25, 11:20 -
Stefan Bürk commented on patch set 3 09/26/25, 11:24
Reply
Thanks. At least it feels a little bit better that way.Reply
Sticked with `__unserialize/__serialize` for now, because that is used in the current default configuration for the `database_schema` cache. I would prefere the `__set_state()` also, but that makes only sense using a code cache like `core` cache, which it was originally. Helmut changed that, and changing that back is out of the scope for this change now. Removed the currently not used `__set_state()` to remove dead code. Set to resolved, hope that is okay.TableInfo.php:47ReplyDoneSchemaInformation.php:47ReplyDone -
Stefan Bürk marked it work in progress 09/26/25, 11:26
-
core-ci voted on patch set 3 V -1 09/26/25, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85594
-
Stefan Bürk uploaded patch set 4
V -109/26/25, 11:45 -
core-ci voted on patch set 4 V -1 09/26/25, 11:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85597
-
Stefan Bürk uploaded patch set 5
V -109/26/25, 12:20 -
core-ci voted on patch set 5 V -1 09/26/25, 12:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85601
-
Stefan Bürk uploaded patch set 6
V -109/26/25, 12:32 -
core-ci voted on patch set 6 V +1 09/26/25, 12:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85602
-
Stefan Bürk marked it ready for review 09/26/25, 12:39
-
Benjamin Franzke uploaded patch set 7
V +110/01/25, 06:50 -
Benjamin Franzke commented on patch set 7 10/01/25, 06:55
ColumnInfo.php:49Hm, `Type::lookupName` implicitly bootstraps the doctrine TypeRegistry, which creates all types and so on. I think i'd only store the `typeName` and only create the type object if actually needed. What do you think?SchemaInformation.php:126Why is this `trim` needed? `$tableName` is an argument to this function to `listTableColumnInfos()`, why do we expect users of this API to provided quoted table names? -
core-ci voted on patch set 7 V +1 10/01/25, 06:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85780
-
Stefan Bürk uploaded patch set 8
V +110/01/25, 07:51 -
Stefan Bürk commented on patch set 7 10/01/25, 07:51
ColumnInfo.php:49ReplyI get your point in the one hand, but I'd keep it that way it is now. What you are mention means, we would need a "getter" for it (`getType()`) getting the type based on `$typeName` ... mixing the public properties with one getter, which feels weired. When we do that, we should make the properties private and provide getters for all of them making the implementation bigger. On the other hand, I'd say that this does not really hurt. Only the typeName is saved (serialized/unserialized) and the Type instace created in the unserialize method to pass it ... and also passed when creating an instance with `ColumnInfo->convertFromDoctrineColumn()` called from `SchemaInformation`. In all the scenarios, when something calls the method to retrieve a ColumnInfo object the doctrine type registry is already bootstrapped and loaded which is part of creating and connecting a database connection, which is required to reach that code. I would rather keep the slimmer public property api for the object and avoid mixing one getter and public property access. How should we continue ? Moving completly to getter and not storing the type as property ?SchemaInformation.php:126ReplyGood point. You are right, we can simply assign `$tableName` here and no need to trim quotes here, which is a left over from earlier tries where this was feed from the doctrine Table object where it could have been quoted. I rechecked this, we don't need the quote trimming at all. That means that it is also not needed to trim the colum name in `ColumnInfo->convertFromDoctrineColumn()` and I removed the platform helper, property and passing the argument now. Removing the quotes was muscle memory from working in the database analyzer stack in the past, which required doing this for the parsed virtual schema based on `ext_tables.sql`. Literally, it would not have done any harm here but as it is not required and needed we can leave that out. -
core-ci voted on patch set 8 V +1 10/01/25, 07:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85783
-
Benjamin Franzke commented on patch set 8 10/06/25, 08:21
ColumnInfo.php:49ReplyIf you dislike the getter, we can resort to use `Type::lookupName($columnInfo->typeName)` is the users of this API. Would that be bearable for you?SchemaInformation.php:126ReplyAlright thanks for the background, then let's leave it out. -
Stefan Bürk uploaded patch set 9
V +110/06/25, 14:11 -
core-ci voted on patch set 9 V +1 10/06/25, 14:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86071
-
Benjamin Franzke commented on patch set 9 CR +1 V +1 10/06/25, 14:33
ColumnInfo.php:49Replydone, thx!SchemaInformation.php:126ReplyDone -
Christian Kuhn commented on patch set 9 10/06/25, 16:21
ColumnInfo.php:77the two methods __serialize() and __unserialize() could be removed now since there is no $type property anymore? did i miss something? -
Stefan Bürk uploaded patch set 10
CR +1V +110/07/25, 08:13 -
Stefan Bürk commented on patch set 10 10/07/25, 08:18
ColumnInfo.php:77ReplyGood point. Yes, not having the `Type $type` property anymore makes the serialize/unserialize methods obsolete now. At first, I thought to keep them to make the mapped data clear and discarded that. The DTO is only internal and not many people working in this area and I think it's better to keep the code clean when it does not have any benefit. Removed the methods here and in `TableInfo`, adding a comment in the static transofrmation method of `ColumnInfo`. -
core-ci voted on patch set 10 V +1 10/07/25, 08:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86132
-
Christian Kuhn voted on patch set 10 CR +1 V +1 10/07/25, 11:55
-
Benjamin Franzke voted on patch set 10 CR +1 V +1 10/07/25, 12:37
-
Stefan Bürk voted on patch set 10 CR +2 V +2 10/07/25, 13:02
-
Stefan Bürk merged patch set 11 10/07/25, 13:20