Review main Merged

3353[BUGFIX] t3libExtMgm does not cache extension version

Björn Pedersen CR +2 V +2 Easy +13 −7 updated 06/03/13, 20:49

Commit message

The t3lib_extMgm::getExtensionVersion function includes
the ext_emconf.php file of an extension each time it is called.

The version is cached using the CF runtime cache.

Review

  • Code review CR +2
    • Steffen Ritter +2
    • Stefan Neufeind +1
    • Georg Ringer +1
    • Philipp Gampe +1
  • Verified V +2
    • Steffen Ritter +2
    • Stefan Neufeind +1
    • Philipp Gampe +1

Issues 1

Files 1

Review log 39

Show 14 earlier messages
  1. Björn Pedersen uploaded patch set 2 07/20/11, 12:12

  2. Björn Pedersen uploaded patch set 3 07/20/11, 12:12

  3. Björn Pedersen commented on patch set 3 07/20/11, 12:12

    I hope I got the usage of the runtime cache right now.
  4. Björn Pedersen commented on patch set 3 07/20/11, 12:12

    @ Christian: Yes, many extensions check for specific versions of e.g. templavoila, causing multiple call to this function with the same key.
  5. Björn Pedersen commented on patch set 3 07/20/11, 12:12

    (1 inline comment)
  6. Björn Pedersen uploaded patch set 4 07/20/11, 12:12

  7. Björn Pedersen uploaded patch set 5 07/20/11, 12:12

  8. Björn Pedersen commented on patch set 5 07/20/11, 12:12

    Patchset 5: took comment into account Some "profiling" information is attached to the Bugtracker.
  9. Andreas Wolf commented on patch set 6 07/20/11, 12:12

    (2 inline comments) I'm not sure if using the CF really makes sense here. Did anybody do a profiling of the usage here against a simple static variable in the method? I think the latter would be sufficient, as we use the method as a general API to access the information everywhere we need it.
  10. Andreas Wolf commented on patch set 6 07/20/11, 12:12

    Except for my spaces nitpicking, yes ;-)
  11. Björn Pedersen uploaded patch set 6 07/20/11, 12:12

  12. Björn Pedersen commented on patch set 6 07/20/11, 12:12

    @Andreas: So you would prefer the solution from patchset 1, correct?
  13. Björn Pedersen uploaded patch set 7 07/20/11, 12:12

  14. Stefan Neufeind commented on patch set 4 1 comment 07/20/11, 12:12

    Looks good to me, but someone else must approve Looks okay just from reading. Took special care that classnames in construct-calls match filename etc.
  1. Stefan Neufeind commented on patch set 4 07/20/11, 12:12

    @Christian: The cache returns NULL if not found. I stumbled across that during debugging today :-)
  2. Stefan Neufeind commented on patch set 4 V 0 07/20/11, 12:12

    Comment from 2:21 was meant to go in https://review.typo3.org/#change,3371 (selected wrong tab *sigh*) But the "review +1" was actually meant to go here. I agree caching is fine and I can then see the benefit of avoiding a double-inclusion. Meanwhile I also gave it a practical test.
  3. Stefan Neufeind commented on patch set 5 1 comment 07/20/11, 12:12

    I would prefer that you didn't submit this nitpick
  4. Stefan Neufeind commented on patch set 5 07/20/11, 12:12

    Verified; Looks good to me, but someone else must approve renewing vote
  5. Stefan Neufeind commented on patch set 6 07/20/11, 12:12

    Verified; Looks good to me, but someone else must approve
  6. Stefan Neufeind commented on patch set 7 07/20/11, 12:12

    Verified; Looks good to me, but someone else must approve Nothing seems to break for me. Didn't verify though if cache actually gets used and we get cache-hits.
  7. Christian Kuhn commented on patch set 3 07/20/11, 12:12

    Is this method called for one extension multiple time during one request?
  8. Christian Kuhn commented on patch set 4 07/20/11, 12:12

    @Björn: Would you like to unit test this change? Would be great. All in all is see no real reason to not cache this information, so I'm basically fine with the change. But I did not dig deep until now. Codewise we could probably remove the ->has() call if the code is restructured a bit (I think ->get() returns NULL if entry does not exist, take a look at the API).
  9. Christian Kuhn commented on patch set 6 07/20/11, 12:12

    @Andreas: I'd rather prefer to have the cf solution ;) It is a common API and if some other extension / core part needs the same information for some it can feed / get it from cf alone, so we need no further additional methods in extMgm. The runtime cache is there anyway and we will also have more places in the core where it will be used. I doubt the cf will be much slower as well (ok it is not as quick as a direct static method, but the runtime cf cache would also be able to run with apc backend and that is actually a nice advantage).
  10. Christian Kuhn commented on patch set 6 07/20/11, 12:12

    A a sidenote: I'm currently not satisfied with the whole cache types and usages throughout the core. Since time before 4.6 ff is short, we will probably review the system for 4.7 anyway, and maybe we can come up with a smarter solution like 'give me a cache that is memory driven and can store my data between requests', and you get something injected. I've discussed something like that with Steffen Gebert already, but its currently to early to do it (we need to clean up other things first).
  11. Georg Ringer commented on patch set 7 07/20/11, 12:12

    Looks good to me, but someone else must approve
  12. Steffen Gebert commented on patch set 1 07/20/11, 12:12

    I would prefer that you didn't submit this Please use the cache_runtime. It's exactly for use cases like this one. See #27208, #27227, #27685

    class.t3lib_extmgm.php:223

    Why not save $EM_CONF[$key]['version'] into a variable and move the get() into an else clause. Cache lookups aren't that expensive, but always calling set() and get() could be avoided.
  13. Steffen Gebert commented on patch set 3 07/20/11, 12:12

    (1 inline comment)
  14. Steffen Gebert commented on patch set 4 07/20/11, 12:12

    Thanks for the update - that's the way I like it. Nevertheless, do you have some profiling data for this change? The CF is not totally for free and while grepping my extension dir, I found no extension calling this function. So is there a real benefit. Including one file is not that expensive.
  15. Philipp Gampe commented on patch set 3 07/20/11, 12:12

    Verified; Looks good to me, but someone else must approve Works for updating l10n and extension list
  16. Philipp Gampe commented on patch set 7 07/20/11, 12:12

    Verified; Looks good to me, but someone else must approve works for works for me ... nothing breaks
  17. Mr. Jenkins commented on patch set 1 07/20/11, 12:12

  18. Mr. Jenkins commented on patch set 2 07/20/11, 12:12

  19. Mr. Jenkins commented on patch set 3 07/20/11, 12:12

  20. Mr. Jenkins commented on patch set 4 07/20/11, 12:12

  21. Mr. Jenkins commented on patch set 5 07/20/11, 12:12

  22. Mr. Jenkins commented on patch set 6 07/20/11, 12:12

  23. Mr. Jenkins commented on patch set 7 07/20/11, 12:12

  24. Steffen Ritter commented on patch set 7 V 0 07/20/11, 12:12

    by team member; Looks good to me, approved
  25. Steffen Ritter merged patch set 7 07/20/11, 12:12