Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/config/schema/PhabricatorConfigServerSchema.php
12256 views
1
<?php
2
3
final class PhabricatorConfigServerSchema
4
extends PhabricatorConfigStorageSchema {
5
6
private $ref;
7
private $databases = array();
8
9
public function setRef(PhabricatorDatabaseRef $ref) {
10
$this->ref = $ref;
11
return $this;
12
}
13
14
public function getRef() {
15
return $this->ref;
16
}
17
18
public function addDatabase(PhabricatorConfigDatabaseSchema $database) {
19
$key = $database->getName();
20
if (isset($this->databases[$key])) {
21
throw new Exception(
22
pht('Trying to add duplicate database "%s"!', $key));
23
}
24
$this->databases[$key] = $database;
25
return $this;
26
}
27
28
public function getDatabases() {
29
return $this->databases;
30
}
31
32
public function getDatabase($key) {
33
return idx($this->getDatabases(), $key);
34
}
35
36
protected function getSubschemata() {
37
return $this->getDatabases();
38
}
39
40
protected function compareToSimilarSchema(
41
PhabricatorConfigStorageSchema $expect) {
42
return array();
43
}
44
45
public function newEmptyClone() {
46
$clone = clone $this;
47
$clone->databases = array();
48
return $clone;
49
}
50
51
}
52
53