Fixed Upgrading/Installing Addon with Wincache Enabled Crashes XenForo

It may/will be painful, yes.

I have some ideas to mitigate but haven't tested them yet.

The current pain points are:
  • CssRenderer::__construct signature has changed and this method is extendable with the XFCP
  • Cache adapter objects are obviously different types now so third party code which expects particular types for arguments or returns will break and will need updating
  • The API is slightly different, as you note, with \XF::cache()->fetch($key) (more or less) becoming \XF::cache()->getItem($key) and \XF::cache()->save($key) now requiring a cache item to be passed in rather than a string cache key.
As it stands, this will break pretty much everything for customers who have add-ons that touch any of the above.

One mitigation I'm thinking of is having some sort of generic wrapper class which takes the real Symfony cache object as an argument, and we can have slightly more familiar fetch and save helper methods attached which proxy through to the adapter class.

This doesn't solve all of the above but the API changing is probably the most significant (in that it's not quite a simple find and replace).
 
Just wanted to follow up to say we're implementing a compatibility shim for Doctrine Cache (enabled by default) which should mitigate any BC breaks (aside from unsupported adapters). An optional third argument can be passed to \XF\App::cache to get an instance of \Symfony\Component\Cache\Adapter\AbstractAdapter instead.
 
Not least being it doesn't appear as though Wincache has any version compatible with PHP 7.2 or above, and the minimum requirements for XF 2.3 will be PHP 7.2.5 and above.
Now that Wincache has been updated to PHP 8.0, is this still not going to happen?
 
Now that Wincache has been updated to PHP 8.0, is this still not going to happen?
Doubtful. It seems to have been patched in a third-party fork but not an official release, and it's not clear if the third-party is committed to taking the project over in the long run. Further, we use Symfony Cache in XF 2.3+ and there is no WinCache adapter available for it.
 
Top Bottom