@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.

Improve compatibility of "Config > Cache Status" across APCu versions

Summary:
Ref T13164. See PHI790. Older versions of APCu reported cache keys as "key" from `apcu_cache_info()`. APC and newer APCu report it as "info".

Check both indexes for compatibility.

Test Plan:
- Locally, with newer APCu, saw no behavioral change.
- Will double check on `admin`, which has an older APCu with the "key" behavior.
- (I hunted this down by dumping `apcu_cache_info()` on `admin` to see what was going on.)

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

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

+15 -2
+15 -2
src/applications/cache/spec/PhabricatorDataCacheSpec.php
··· 106 106 $cache = $info['cache_list']; 107 107 $state = array(); 108 108 foreach ($cache as $item) { 109 - $info = idx($item, 'info', '<unknown-key>'); 110 - $key = self::getKeyPattern($info); 109 + // Some older versions of APCu report the cachekey as "key", while 110 + // newer APCu and APC report it as "info". Just check both indexes 111 + // for commpatibility. See T13164 for details. 112 + 113 + $info = idx($item, 'info'); 114 + if ($info === null) { 115 + $info = idx($item, 'key'); 116 + } 117 + 118 + if ($info === null) { 119 + $key = '<unknown-key>'; 120 + } else { 121 + $key = self::getKeyPattern($info); 122 + } 123 + 111 124 if (empty($state[$key])) { 112 125 $state[$key] = array( 113 126 'max' => 0,