@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
3final class PhabricatorConfigDictionarySource
4 extends PhabricatorConfigSource {
5
6 private $dictionary;
7
8 public function __construct(array $dictionary) {
9 $this->dictionary = $dictionary;
10 }
11
12 public function getAllKeys() {
13 return $this->dictionary;
14 }
15
16 public function getKeys(array $keys) {
17 return array_select_keys($this->dictionary, $keys);
18 }
19
20 public function canWrite() {
21 return true;
22 }
23
24 public function setKeys(array $keys) {
25 $this->dictionary = $keys + $this->dictionary;
26 return $this;
27 }
28
29 public function deleteKeys(array $keys) {
30 foreach ($keys as $key) {
31 unset($this->dictionary[$key]);
32 }
33 return $keys;
34 }
35
36}