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

Add --purge-user to bin/cache purge

Summary: Ref T4103. Provide a CLI mechanism for purging the user cache.

Test Plan:
- Purged with `--purge-user` and `--purge-all`.
- Verified cache table got wiped.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4103

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

+21
+21
src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php
··· 26 26 'name' => 'purge-general', 27 27 'help' => pht('Purge the general cache.'), 28 28 ), 29 + array( 30 + 'name' => 'purge-user', 31 + 'help' => pht('Purge the user cache.'), 32 + ), 29 33 )); 30 34 } 31 35 ··· 38 42 'remarkup' => $purge_all || $args->getArg('purge-remarkup'), 39 43 'changeset' => $purge_all || $args->getArg('purge-changeset'), 40 44 'general' => $purge_all || $args->getArg('purge-general'), 45 + 'user' => $purge_all || $args->getArg('purge-user'), 41 46 ); 42 47 43 48 if (!array_filter($purge)) { ··· 70 75 if ($purge['general']) { 71 76 $console->writeOut(pht('Purging general cache...')); 72 77 $this->purgeGeneralCache(); 78 + $console->writeOut("%s\n", pht('Done.')); 79 + } 80 + 81 + if ($purge['user']) { 82 + $console->writeOut(pht('Purging user cache...')); 83 + $this->purgeUserCache(); 73 84 $console->writeOut("%s\n", pht('Done.')); 74 85 } 75 86 } ··· 98 109 $conn_w, 99 110 'TRUNCATE TABLE %T', 100 111 'cache_general'); 112 + } 113 + 114 + private function purgeUserCache() { 115 + $table = new PhabricatorUserCache(); 116 + $conn_w = $table->establishConnection('w'); 117 + 118 + queryfx( 119 + $conn_w, 120 + 'TRUNCATE TABLE %T', 121 + $table->getTableName()); 101 122 } 102 123 103 124 }