Smart APC cache should use APCu

I believe there is a bug with smart cache that relies on ‘apc_add’ function: $options->apc = $options->apc && function_exists(‘apc_add’);

However, this function is discountinued long time ago and replace with APCu (apcu_add) - see PHP: Manual Quick Reference

This baically means APC cache will never work, but the fix is trivial: just replace all apc_* with apcu_*
APCu is the official replacement for the outdated APC extension.

Hi @ap2, we will probably update this in a future version.

We kept the apc calls because the transition to apcu was happening when many people were still using the original apc calls. And there has been a backwards-compatibility package for a while that would allow you to continue to use the previous calls with the newer apcu - which is what we do in our hosted service. But it’s probably time to update those calls.

APC has been discontinued since PHP5, it’s probably time to update :slight_smile:

Hi @ap2, if my reply wasn’t clear, we already use APCU but with the old apc function calls (which you can do if you run the backwards-compatibility package I linked). So the code we run and the code users of our self-hosted package who install it via our install script run does already use APCU, and not APC. Updating the function names won’t change that, but will mean we can stop relying on the backwards compatibility package.