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

PhabricatorCaches use namespace if set

Summary: PhabricatorCaches now uses namespaced caches if cofig option for cache is set.

Test Plan: noidea

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2786

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

authored by

Lauri-Henrik Jalonen and committed by
epriestley
9a15f243 004a8de3

+19
+15
src/applications/cache/PhabricatorCaches.php
··· 5 5 */ 6 6 final class PhabricatorCaches { 7 7 8 + public static function getNamespace() { 9 + return PhabricatorEnv::getEnvConfig('phabricator.cache-namespace'); 10 + } 8 11 9 12 /* -( Setup Cache )-------------------------------------------------------- */ 10 13 ··· 42 45 // In most cases, we should have APC. This is an ideal cache for our 43 46 // purposes -- it's fast and empties on server restart. 44 47 $apc = new PhutilKeyValueCacheAPC(); 48 + 49 + if (PhabricatorCaches::getNamespace()) { 50 + $apc = id(new PhutilKeyValueCacheNamespace($apc)) 51 + ->setNamespace(PhabricatorCaches::getNamespace()); 52 + } 53 + 45 54 if ($apc->isAvailable()) { 46 55 return array($apc); 47 56 } ··· 51 60 $disk_path = self::getSetupCacheDiskCachePath(); 52 61 if ($disk_path) { 53 62 $disk = new PhutilKeyValueCacheOnDisk(); 63 + 64 + if (PhabricatorCaches::getNamespace()) { 65 + $disk = id(new PhutilKeyValueCacheNamespace($disk)) 66 + ->setNamespace(PhabricatorCaches::getNamespace()); 67 + } 68 + 54 69 $disk->setCacheFile($disk_path); 55 70 if ($disk->isAvailable()) { 56 71 return array($disk);
+4
src/applications/config/option/PhabricatorCoreConfigOptions.php
··· 139 139 ->setLocked(true) 140 140 ->setDescription( 141 141 pht('Custom HTML to show on the main Phabricator dashboard.')), 142 + $this->newOption('phabricator.cache-namespace', 'string', null) 143 + ->setLocked(true) 144 + ->setDescription(pht('Cache namespace.')), 142 145 ); 146 + 143 147 } 144 148 145 149 protected function didValidateOption(