diff --git a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php --- a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php +++ b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php @@ -26,6 +26,10 @@ 'name' => 'purge-general', 'help' => pht('Purge the general cache.'), ), + array( + 'name' => 'purge-user', + 'help' => pht('Purge the user cache.'), + ), )); } @@ -38,6 +42,7 @@ 'remarkup' => $purge_all || $args->getArg('purge-remarkup'), 'changeset' => $purge_all || $args->getArg('purge-changeset'), 'general' => $purge_all || $args->getArg('purge-general'), + 'user' => $purge_all || $args->getArg('purge-user'), ); if (!array_filter($purge)) { @@ -72,6 +77,12 @@ $this->purgeGeneralCache(); $console->writeOut("%s\n", pht('Done.')); } + + if ($purge['user']) { + $console->writeOut(pht('Purging user cache...')); + $this->purgeUserCache(); + $console->writeOut("%s\n", pht('Done.')); + } } private function purgeRemarkupCache() { @@ -100,4 +111,14 @@ 'cache_general'); } + private function purgeUserCache() { + $table = new PhabricatorUserCache(); + $conn_w = $table->establishConnection('w'); + + queryfx( + $conn_w, + 'TRUNCATE TABLE %T', + $table->getTableName()); + } + }