@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<?php
2
3/**
4 * @template R of PhabricatorPolicyInterface
5 * @extends PhabricatorCursorPagedPolicyAwareQuery<R>
6 */
7abstract class PhabricatorPackagesQuery
8 extends PhabricatorCursorPagedPolicyAwareQuery {
9
10 public function getQueryApplicationClass() {
11 return PhabricatorPackagesApplication::class;
12 }
13
14 protected function buildFullKeyClauseParts(
15 AphrontDatabaseConnection $conn,
16 array $full_keys) {
17
18 $parts = array();
19 foreach ($full_keys as $full_key) {
20 $key_parts = explode('/', $full_key, 2);
21
22 if (count($key_parts) != 2) {
23 continue;
24 }
25
26 $parts[] = qsprintf(
27 $conn,
28 '(u.publisherKey = %s AND p.packageKey = %s)',
29 $key_parts[0],
30 $key_parts[1]);
31 }
32
33 // If none of the full keys we were provided were valid, we don't
34 // match any results.
35 if (!$parts) {
36 throw new PhabricatorEmptyQueryException();
37 }
38
39 return qsprintf($conn, '%LO', $parts);
40 }
41
42}