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

Convert simple query subclasses to use internal cursors

Summary:
Depends on D20291. Ref T13259. Move all the simple cases (where paging depends only on the partial object and does not depend on keys) to a simple wrapper.

This leaves a smaller set of more complex cases where we care about external data or which keys were requested that I'll convert in followups.

Test Plan: Poked at things, but a lot of stuff is still broken until everything is converted.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13259

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

+61 -84
+3 -4
src/applications/almanac/query/AlmanacDeviceQuery.php
··· 122 122 ); 123 123 } 124 124 125 - protected function getPagingValueMap($cursor, array $keys) { 126 - $device = $this->loadCursorObject($cursor); 125 + protected function newPagingMapFromPartialObject($object) { 127 126 return array( 128 - 'id' => $device->getID(), 129 - 'name' => $device->getName(), 127 + 'id' => (int)$object->getID(), 128 + 'name' => $object->getName(), 130 129 ); 131 130 } 132 131
+3 -4
src/applications/almanac/query/AlmanacNamespaceQuery.php
··· 79 79 ); 80 80 } 81 81 82 - protected function getPagingValueMap($cursor, array $keys) { 83 - $namespace = $this->loadCursorObject($cursor); 82 + protected function newPagingMapFromPartialObject($object) { 84 83 return array( 85 - 'id' => $namespace->getID(), 86 - 'name' => $namespace->getName(), 84 + 'id' => (int)$object->getID(), 85 + 'name' => $object->getName(), 87 86 ); 88 87 } 89 88
+3 -4
src/applications/almanac/query/AlmanacServiceQuery.php
··· 206 206 ); 207 207 } 208 208 209 - protected function getPagingValueMap($cursor, array $keys) { 210 - $service = $this->loadCursorObject($cursor); 209 + protected function newPagingMapFromPartialObject($object) { 211 210 return array( 212 - 'id' => $service->getID(), 213 - 'name' => $service->getName(), 211 + 'id' => (int)$object->getID(), 212 + 'name' => $object->getName(), 214 213 ); 215 214 } 216 215
+4 -4
src/applications/badges/query/PhabricatorBadgesQuery.php
··· 108 108 ) + parent::getOrderableColumns(); 109 109 } 110 110 111 - protected function getPagingValueMap($cursor, array $keys) { 112 - $badge = $this->loadCursorObject($cursor); 111 + 112 + protected function newPagingMapFromPartialObject($object) { 113 113 return array( 114 - 'quality' => $badge->getQuality(), 115 - 'id' => $badge->getID(), 114 + 'id' => (int)$object->getID(), 115 + 'quality' => $object->getQuality(), 116 116 ); 117 117 } 118 118
+3 -4
src/applications/calendar/query/PhabricatorCalendarEventQuery.php
··· 140 140 ) + parent::getOrderableColumns(); 141 141 } 142 142 143 - protected function getPagingValueMap($cursor, array $keys) { 144 - $event = $this->loadCursorObject($cursor); 143 + protected function newPagingMapFromPartialObject($object) { 145 144 return array( 146 - 'start' => $event->getStartDateTimeEpoch(), 147 - 'id' => $event->getID(), 145 + 'id' => (int)$object->getID(), 146 + 'start' => (int)$object->getStartDateTimeEpoch(), 148 147 ); 149 148 } 150 149
+3 -4
src/applications/countdown/query/PhabricatorCountdownQuery.php
··· 97 97 ) + parent::getOrderableColumns(); 98 98 } 99 99 100 - protected function getPagingValueMap($cursor, array $keys) { 101 - $countdown = $this->loadCursorObject($cursor); 100 + protected function newPagingMapFromPartialObject($object) { 102 101 return array( 103 - 'epoch' => $countdown->getEpoch(), 104 - 'id' => $countdown->getID(), 102 + 'id' => (int)$object->getID(), 103 + 'epoch' => (int)$object->getEpoch(), 105 104 ); 106 105 } 107 106
+3 -4
src/applications/differential/query/DifferentialRevisionQuery.php
··· 800 800 ) + parent::getOrderableColumns(); 801 801 } 802 802 803 - protected function getPagingValueMap($cursor, array $keys) { 804 - $revision = $this->loadCursorObject($cursor); 803 + protected function newPagingMapFromPartialObject($object) { 805 804 return array( 806 - 'id' => $revision->getID(), 807 - 'updated' => $revision->getDateModified(), 805 + 'id' => (int)$object->getID(), 806 + 'updated' => (int)$object->getDateModified(), 808 807 ); 809 808 } 810 809
+3 -4
src/applications/diffusion/query/DiffusionCommitQuery.php
··· 924 924 ); 925 925 } 926 926 927 - protected function getPagingValueMap($cursor, array $keys) { 928 - $commit = $this->loadCursorObject($cursor); 927 + protected function newPagingMapFromPartialObject($object) { 929 928 return array( 930 - 'id' => $commit->getID(), 931 - 'epoch' => $commit->getEpoch(), 929 + 'id' => (int)$object->getID(), 930 + 'epoch' => (int)$object->getEpoch(), 932 931 ); 933 932 } 934 933
+3 -4
src/applications/diviner/query/DivinerBookQuery.php
··· 181 181 ); 182 182 } 183 183 184 - protected function getPagingValueMap($cursor, array $keys) { 185 - $book = $this->loadCursorObject($cursor); 186 - 184 + protected function newPagingMapFromPartialObject($object) { 187 185 return array( 188 - 'name' => $book->getName(), 186 + 'id' => (int)$object->getID(), 187 + 'name' => $object->getName(), 189 188 ); 190 189 } 191 190
+3 -4
src/applications/harbormaster/query/HarbormasterBuildPlanQuery.php
··· 133 133 ); 134 134 } 135 135 136 - protected function getPagingValueMap($cursor, array $keys) { 137 - $plan = $this->loadCursorObject($cursor); 136 + protected function newPagingMapFromPartialObject($object) { 138 137 return array( 139 - 'id' => $plan->getID(), 140 - 'name' => $plan->getName(), 138 + 'id' => (int)$object->getID(), 139 + 'name' => $object->getName(), 141 140 ); 142 141 } 143 142
+3 -4
src/applications/macro/query/PhabricatorMacroQuery.php
··· 249 249 ); 250 250 } 251 251 252 - protected function getPagingValueMap($cursor, array $keys) { 253 - $macro = $this->loadCursorObject($cursor); 252 + protected function newPagingMapFromPartialObject($object) { 254 253 return array( 255 - 'id' => $macro->getID(), 256 - 'name' => $macro->getName(), 254 + 'id' => (int)$object->getID(), 255 + 'name' => $object->getName(), 257 256 ); 258 257 } 259 258
+3 -4
src/applications/owners/query/PhabricatorOwnersPackageQuery.php
··· 267 267 ); 268 268 } 269 269 270 - protected function getPagingValueMap($cursor, array $keys) { 271 - $package = $this->loadCursorObject($cursor); 270 + protected function newPagingMapFromPartialObject($object) { 272 271 return array( 273 - 'id' => $package->getID(), 274 - 'name' => $package->getName(), 272 + 'id' => (int)$object->getID(), 273 + 'name' => $object->getName(), 275 274 ); 276 275 } 277 276
+3 -4
src/applications/people/query/PhabricatorPeopleQuery.php
··· 379 379 ); 380 380 } 381 381 382 - protected function getPagingValueMap($cursor, array $keys) { 383 - $user = $this->loadCursorObject($cursor); 382 + protected function newPagingMapFromPartialObject($object) { 384 383 return array( 385 - 'id' => $user->getID(), 386 - 'username' => $user->getUsername(), 384 + 'id' => (int)$object->getID(), 385 + 'username' => $object->getUsername(), 387 386 ); 388 387 } 389 388
+4 -8
src/applications/phame/query/PhamePostQuery.php
··· 171 171 ); 172 172 } 173 173 174 - protected function getPagingValueMap($cursor, array $keys) { 175 - $post = $this->loadCursorObject($cursor); 176 - 177 - $map = array( 178 - 'datePublished' => $post->getDatePublished(), 179 - 'id' => $post->getID(), 174 + protected function newPagingMapFromPartialObject($object) { 175 + return array( 176 + 'id' => (int)$object->getID(), 177 + 'datePublished' => (int)$object->getDatePublished(), 180 178 ); 181 - 182 - return $map; 183 179 } 184 180 185 181 public function getQueryApplicationClass() {
+2 -2
src/applications/phlux/query/PhluxVariableQuery.php
··· 81 81 ); 82 82 } 83 83 84 - protected function getPagingValueMap($cursor, array $keys) { 85 - $object = $this->loadCursorObject($cursor); 84 + protected function newPagingMapFromPartialObject($object) { 86 85 return array( 86 + 'id' => (int)$object->getID(), 87 87 'key' => $object->getVariableKey(), 88 88 ); 89 89 }
+4 -5
src/applications/phrequent/query/PhrequentUserTimeQuery.php
··· 133 133 ); 134 134 } 135 135 136 - protected function getPagingValueMap($cursor, array $keys) { 137 - $usertime = $this->loadCursorObject($cursor); 136 + protected function newPagingMapFromPartialObject($object) { 138 137 return array( 139 - 'id' => $usertime->getID(), 140 - 'start' => $usertime->getDateStarted(), 141 - 'end' => $usertime->getDateEnded(), 138 + 'id' => (int)$object->getID(), 139 + 'start' => (int)$object->getDateStarted(), 140 + 'end' => (int)$object->getDateEnded(), 142 141 ); 143 142 } 144 143
-7
src/applications/phurl/query/PhabricatorPhurlURLQuery.php
··· 50 50 return $this; 51 51 } 52 52 53 - protected function getPagingValueMap($cursor, array $keys) { 54 - $url = $this->loadCursorObject($cursor); 55 - return array( 56 - 'id' => $url->getID(), 57 - ); 58 - } 59 - 60 53 protected function loadPage() { 61 54 return $this->loadStandardPage($this->newResultObject()); 62 55 }
+4 -5
src/applications/project/query/PhabricatorProjectQuery.php
··· 201 201 ); 202 202 } 203 203 204 - protected function getPagingValueMap($cursor, array $keys) { 205 - $project = $this->loadCursorObject($cursor); 204 + protected function newPagingMapFromPartialObject($object) { 206 205 return array( 207 - 'id' => $project->getID(), 208 - 'name' => $project->getName(), 209 - 'status' => $project->getStatus(), 206 + 'id' => (int)$object->getID(), 207 + 'name' => $object->getName(), 208 + 'status' => $object->getStatus(), 210 209 ); 211 210 } 212 211
+3 -5
src/applications/releeph/query/ReleephProductQuery.php
··· 130 130 ); 131 131 } 132 132 133 - protected function getPagingValueMap($cursor, array $keys) { 134 - $product = $this->loadCursorObject($cursor); 135 - 133 + protected function newPagingMapFromPartialObject($object) { 136 134 return array( 137 - 'id' => $product->getID(), 138 - 'name' => $product->getName(), 135 + 'id' => (int)$object->getID(), 136 + 'name' => $object->getName(), 139 137 ); 140 138 } 141 139
+4
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
··· 62 62 63 63 $object = $cursor->getObject(); 64 64 65 + return $this->newPagingMapFromPartialObject($object); 66 + } 67 + 68 + protected function newPagingMapFromPartialObject($object) { 65 69 return array( 66 70 'id' => (int)$object->getID(), 67 71 );