Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigServerSchema.php
<?php | <?php | ||||
final class PhabricatorConfigServerSchema extends Phobject { | final class PhabricatorConfigServerSchema | ||||
extends PhabricatorConfigStorageSchema { | |||||
private $databases = array(); | private $databases = array(); | ||||
public function addDatabase(PhabricatorConfigDatabaseSchema $database) { | public function addDatabase(PhabricatorConfigDatabaseSchema $database) { | ||||
$key = $database->getName(); | $key = $database->getName(); | ||||
if (isset($this->databases[$key])) { | if (isset($this->databases[$key])) { | ||||
throw new Exception( | throw new Exception( | ||||
pht('Trying to add duplicate database "%s"!', $key)); | pht('Trying to add duplicate database "%s"!', $key)); | ||||
} | } | ||||
$this->databases[$key] = $database; | $this->databases[$key] = $database; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getDatabases() { | public function getDatabases() { | ||||
return $this->databases; | return $this->databases; | ||||
} | } | ||||
public function getDatabase($key) { | public function getDatabase($key) { | ||||
return idx($this->getDatabases(), $key); | return idx($this->getDatabases(), $key); | ||||
} | } | ||||
protected function getSubschemata() { | |||||
return $this->getDatabases(); | |||||
} | |||||
public function compareToSimilarSchema( | |||||
PhabricatorConfigStorageSchema $expect) { | |||||
return array(); | |||||
} | |||||
public function newEmptyClone() { | |||||
$clone = clone $this; | |||||
$clone->databases = array(); | |||||
return $clone; | |||||
} | |||||
} | } |