Path: blob/master/src/applications/config/schema/PhabricatorConfigDatabaseSchema.php
12262 views
<?php12final class PhabricatorConfigDatabaseSchema3extends PhabricatorConfigStorageSchema {45private $characterSet;6private $collation;7private $tables = array();8private $accessDenied;910public function addTable(PhabricatorConfigTableSchema $table) {11$key = $table->getName();12if (isset($this->tables[$key])) {1314if ($key == 'application_application') {15// NOTE: This is a terrible hack to allow Application subclasses to16// extend LiskDAO so we can apply transactions to them.17return $this;18}1920throw new Exception(21pht('Trying to add duplicate table "%s"!', $key));22}23$this->tables[$key] = $table;24return $this;25}2627public function getTables() {28return $this->tables;29}3031public function getTable($key) {32return idx($this->tables, $key);33}3435protected function getSubschemata() {36return $this->getTables();37}3839protected function compareToSimilarSchema(40PhabricatorConfigStorageSchema $expect) {4142$issues = array();43if ($this->getAccessDenied()) {44$issues[] = self::ISSUE_ACCESSDENIED;45} else {46if ($this->getCharacterSet() != $expect->getCharacterSet()) {47$issues[] = self::ISSUE_CHARSET;48}4950if ($this->getCollation() != $expect->getCollation()) {51$issues[] = self::ISSUE_COLLATION;52}53}5455return $issues;56}5758public function newEmptyClone() {59$clone = clone $this;60$clone->tables = array();61return $clone;62}6364public function setCollation($collation) {65$this->collation = $collation;66return $this;67}6869public function getCollation() {70return $this->collation;71}7273public function setCharacterSet($character_set) {74$this->characterSet = $character_set;75return $this;76}7778public function getCharacterSet() {79return $this->characterSet;80}8182public function setAccessDenied($access_denied) {83$this->accessDenied = $access_denied;84return $this;85}8687public function getAccessDenied() {88return $this->accessDenied;89}9091}929394