@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 * Configuration source which proxies some other configuration source.
5 */
6abstract class PhabricatorConfigProxySource
7 extends PhabricatorConfigSource {
8
9 private $source;
10
11 final protected function getSource() {
12 if (!$this->source) {
13 throw new Exception(pht('No configuration source set!'));
14 }
15 return $this->source;
16 }
17
18 final protected function setSource(PhabricatorConfigSource $source) {
19 $this->source = $source;
20 return $this;
21 }
22
23 public function getAllKeys() {
24 return $this->getSource()->getAllKeys();
25 }
26
27 public function getKeys(array $keys) {
28 return $this->getSource()->getKeys($keys);
29 }
30
31 public function canWrite() {
32 return $this->getSource()->canWrite();
33 }
34
35 public function setKeys(array $keys) {
36 $this->getSource()->setKeys($keys);
37 return $this;
38 }
39
40 public function deleteKeys(array $keys) {
41 $this->getSource()->deleteKeys($keys);
42 return $this;
43 }
44
45 public function setName($name) {
46 $this->getSource()->setName($name);
47 return $this;
48 }
49
50 public function getName() {
51 return $this->getSource()->getName();
52 }
53
54}