Review main Merged

48047[TASK] Make driver registry TCA change cacheable

Helmut Hummel CR +2 V +2 Easy +4 −8 updated 05/18/16, 07:29

Commit message

Instead of calling the driver registry on every request,
we can cache the TCA addition, by putting the call into overrides.

Review

  • Code review CR +2
    • Markus Klein +2
    • Wouter Wolters +1
    • Nicole Hummel +1
  • Verified V +2
    • Markus Klein +2
    • Nicole Hummel +1

Issues 1

Files 3

Review log 25

  1. Helmut Hummel uploaded patch set 1 05/09/16, 17:54

  2. Markus Klein commented on patch set 1 05/09/16, 18:24

    sys_file_storage.php:5

    IMO we shouldn't do that... also not in an override
  3. Markus Klein commented on patch set 2 05/09/16, 18:24

    Published edit on patch set 1.
  4. Helmut Hummel commented on patch set 1 05/09/16, 18:25

    sys_file_storage.php:5 Reply

    1. why? 2. what do you mean by "also not in an override"
  5. Helmut Hummel commented on patch set 2 05/09/16, 18:26

    don't mind to remove the import, just be interested what the exact problem is with that
  6. Markus Klein commented on patch set 2 05/09/16, 18:29

    If multiple overrides do that, we run into a PHP error that we can't "use" the same class twice. With "also not in an override" I mean that we officially forbid use statements in ext_tables/ext_localconf.
  7. Markus Klein commented on patch set 2 05/09/16, 18:32

    Can we really do that change actually? If I consider an ext that adds a driver to $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'], it will not be taken into account anymore, right? (core is loaded as the very first extension)
  8. Frans Saris commented on patch set 2 05/09/16, 18:41

    Won't this break for every extension that calls registerDriverClass in ext_localconf? Or are the overrides loaded before ext_localconf?
  9. Helmut Hummel commented on patch set 2 05/09/16, 19:09

    We have the following order in the bootstrap 1. bootstrap->configure() loads ext_localconf.php files of **ALL** extensions. ::registerDriverClass calls of *all* extensions will successfully register the drivers in TYPO3_CONF_VARS 2. bootstrap->loadExtensionTables() is called, which calls ExtensionManagementUtility::loadBaseTca(), which iterates over every extensions Configuration/TCA files **individually** and caches the resulting **TCA** array, **not** the code in Overrides. 1. https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Http/Application.php#L74 2. https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Core/Bootstrap.php#L968-L970
  10. Helmut Hummel commented on patch set 2 05/09/16, 19:10

    > Won't this break for every extension that calls registerDriverClass in ext_localconf? By reading the explanation above: how would this break? > Or are the overrides loaded before ext_localconf? overrides are loaded **AFTER** ext_localconf,php files of extensions, and this is why it does not break anything. Or do I miss something here?
  11. Helmut Hummel commented on patch set 2 05/09/16, 19:13

    > If multiple overrides do that, we run into a PHP error that we can't "use" the same class twice. That is wrong. The override files are included individually (if cache is empty) and never concatenated. > we officially forbid use statements in ext_tables/ext_localconf. yes, because these files are concatenated in the end, overrides are not To be honest, I don't care. I'm fine with having the rule to not import namespaces in TCA overrides files just to be consistent
  12. Frans Saris voted on patch set 2 CR +1 05/09/16, 19:31

  13. Markus Klein commented on patch set 2 05/09/16, 19:51

    "use" stmt: Okay right, I missed that those are not concat. So we can shorten that again of course. My mistake. If I think about that in general, I would even go one step further and put that very call into the bootstrap code where TCA is being built. FAL is a vital part anyway and the sysext:core is always loaded. There is no point of using an override just for that. What do you think?
  14. Wouter Wolters updated the commit message in patch set 3 05/10/16, 08:04

  15. Nicole Hummel commented on patch set 3 CR +1 05/10/16, 09:42

    DriverRegistry.php:90

    This can be removed because (new) drivers are needed in FE as well, am I right?
  16. Helmut Hummel commented on patch set 3 05/11/16, 15:05

    DriverRegistry.php:90 Reply

    This must be removed, to avoid inconsistent cache state, when fronted request is done first with empty caches
  17. Nicole Hummel voted on patch set 3 V +1 05/11/16, 17:35

  18. Wouter Wolters voted on patch set 3 CR +1 05/11/16, 18:21

  19. Markus Klein commented on patch set 3 05/11/16, 18:54

    sys_file_storage.php:4

    Shouldn't we rather put this line directly into \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::buildBaseTcaFromSingleFiles()?
  20. Nicole Hummel commented on patch set 3 05/11/16, 19:16

    sys_file_storage.php:4 Reply

    This would prevent any other adaptation afterwards
  21. Markus Klein commented on patch set 3 CR +1 05/11/16, 22:45

    sys_file_storage.php:4 Reply

    True, but do we want an adaption to happen at all? I mean you register a driver, but why on earth would you modify the generated TCA for the storage record?
  22. Helmut Hummel commented on patch set 3 05/18/16, 07:14

    sys_file_storage.php:4 Reply

    No matter wether you want to change that afterwards or not. when deciding for coupled vs decoupled, I'd always opt for decoupled
  23. Markus Klein voted on patch set 3 CR +2 V +2 05/18/16, 07:28

  24. Gerrit merged patch set 3 05/18/16, 07:28

  25. Markus Klein commented on patch set 4 05/18/16, 07:29

    Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit fba1a39a1ad3206509ce83ff8c742b6851a82a3f