@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When "apcu_clear_cache()" exists, prefer it as a cache clear callback over "apc_clear_cache()"

Summary:
See PHI36. APCu originally had `apc_` methods, but at some point dropped these and only provides `apcu_` methods.

When the `apcu_` method is present, use it. It may not be present for older versions of APCu, so keep the fallback.

Test Plan:
- With modern APCu, clicked "Purge Caches" in Config > Caches.
- Before: fatal on bad `apc_clear_caches` call.
- After: Valid cache clear.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D18449

+7 -1
+7 -1
src/applications/cache/spec/PhabricatorDataCacheSpec.php
··· 50 50 ->setVersion(phpversion('apcu')); 51 51 52 52 if (ini_get('apc.enabled')) { 53 + if (function_exists('apcu_clear_cache')) { 54 + $clear_callback = 'apcu_clear_cache'; 55 + } else { 56 + $clear_callback = 'apc_clear_cache'; 57 + } 58 + 53 59 $this 54 60 ->setIsEnabled(true) 55 - ->setClearCacheCallback('apc_clear_cache'); 61 + ->setClearCacheCallback($clear_callback); 56 62 $this->initAPCCommonSpec(); 57 63 } else { 58 64 $this->setIsEnabled(false);