Review main Merged

47024[BUGFIX] Use APCu instead of APC for Caching

Benni Mack CR +2 V +2 Hard +441 −4 updated 06/14/16, 13:12

Commit message

PHP 5.5 does not support APC anymore, but instead uses
APCu for everything that is in the userland.

Our code should be adapted to use APCu instead, since
TYPO3 CMS 7 LTS requires PHP 5.5+.

However, there are some edge cases where APCu is available
as APC, so the existing APC code is kept.

Review

  • Code review CR +2
    • Oliver Hader +2
    • Alexander Opitz +1
    • Steffen Müller +1
  • Verified V +2
    • Oliver Hader +2
    • Alexander Opitz +1
    • Steffen Müller +1

Issues 1

Files 5

Review log 27

Show 2 earlier messages
  1. Benni Mack uploaded patch set 1 03/03/16, 20:12

  2. Frank Nägler voted on patch set 1 CR +1 03/04/16, 08:54

  1. Wouter Wolters voted on patch set 1 CR +1 03/04/16, 08:55

  2. Mathias Brodala commented on patch set 1 CR -1 03/04/16, 08:56

    I'd like to clarify the impact of having "apc" loaded and "apcu" not.

    ApcBackend.php:80

    Doesn't make this the change breaking in case someone was only using "apc" before?
  3. Andreas Allacher commented on patch set 1 03/04/16, 08:57

    ApcBackend.php:80 Reply

    Just wanted to mention the same :)
  4. Mathias Brodala commented on patch set 1 CR 0 03/04/16, 09:07

    The extension "apc" is not available for PHP >= 5.5 at all, thus no breaking change here.
  5. Alexander Opitz commented on patch set 1 CR -1 03/04/16, 10:42

    Shouldn't the ApcPreset.php also changed?
    Backport to 7.6? IMHO It isn't really needed as installed APCu can be identified the old way (which coursed troubles in OpcodeCache identification).

    ApcBackend.php:80 Reply

    Only as notice here: It isn't breaking. As of PHP >=5.5 only the APCu extension is working.
  6. Christian Kuhn commented on patch set 1 03/04/16, 10:45

    Reply

    what exactly do you mean with this sentence? could you rephrase, please? why did you vote -1?
  7. Alexander Opitz commented on patch set 1 03/04/16, 11:37

    Reply

    APCu 4.x is compatible with PHP 5.5/5.6 and uses the old apc_* functions, new apc_* fanctions and can be identified with "extension_loaded('apc')" and "extension_loaded('apcu')" APCu 5.1.x is compatible with PHP 5.6 only uses the apcu_* functions and can be identified with and "extension_loaded('apcu')" For APCu 5.1.x there is a apcu_bc extension which brings the "old" behavior back to APCu 5.1.x.
  8. Benni Mack uploaded patch set 2 03/04/16, 11:38

  9. Alexander Opitz commented on patch set 2 03/04/16, 11:40

    Apc.html:31

    APCu 4.x

    Apcu.html:27

    APCu 5.x
  10. Benni Mack wrote 03/04/16, 18:18

    Patch set 3: Published edit on patch set 2.
  11. Alexander Opitz voted on patch set 3 CR +1 V +1 03/07/16, 08:33

  12. Wouter Wolters commented on patch set 3 CR -1 03/07/16, 08:43

    ApcuBackend.php:94

    Can we import the complete namespace instead of a short part?

    ApcuBackend.php:150

    The exception numbers are already in use
  13. Benni Mack uploaded patch set 4 03/09/16, 08:05

  14. Alexander Opitz voted on patch set 4 CR +1 V +1 03/18/16, 11:57

  15. Steffen Müller uploaded patch set 5 03/21/16, 15:26

  16. Steffen Müller commented on patch set 5 CR +1 V +1 03/21/16, 15:30

    New installations from scratch set apcu as backend for extbase_object, if: * apcu installed * apcu AND apcu_bc installed

    ApcuBackend.php:94 Reply

    Done
  17. Alexander Opitz voted on patch set 5 CR +1 V +1 03/21/16, 16:43

  18. Oliver Hader commented on patch set 5 CR -1 03/21/16, 16:58

    Added some remarks... since commit message says, that APC and APCu might be used side by side in edge cases, I think the prefixes (e.g. tag prefix) should be unique on the used technology (APCBE vs APCuBE)

    ApcuBackend.php:73

    FLOW3?

    ApcuBackend.php:98

    Can we use full MD5 or even SHA1 here?

    ApcuBackend.php:143

    Should that one be different to the old APC Backend?
  19. Oliver Hader commented on patch set 5 CR 0 03/21/16, 17:20

    Removing my -1 after sorting out the "edge cases" with Benni. That would only affect PHP 5.5 with either one of them being available. Explicitly running APC and APCu side-by-side does not make sense in terms of a separated cache prefix...
  20. Oliver Hader commented on patch set 5 V +1 03/21/16, 17:38

    Validated functionality with apcu_cache_info()
  21. Oliver Hader commented on patch set 5 CR +1 03/21/16, 17:41

    ApcuBackend.php:98 Reply

    Fine, since it should be behave like APC for the time being... However, hash collisions still might occur

    ApcuBackend.php:143 Reply

    Fine... like APC
  22. Oliver Hader voted on patch set 5 CR +2 V +2 03/21/16, 17:42

  23. Gerrit merged patch set 5 03/21/16, 17:42

  24. Oliver Hader commented on patch set 6 03/21/16, 17:43

    Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit 8b4cb1eaaa018ff91572e2850385cd4534774dc9
  25. Christian Kuhn commented on patch set 6 06/14/16, 13:12

    oehm ... it seems we forgot to add unit tests for this backend ... should have been easy by copying those from apc over.