X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FDatabaseStructure.php;h=4d4125e88a7d6cf2f9de7f919221caa7feb64fc0;hb=e659a0314086dd700dbe5e754e383ab758725805;hp=b44400c01a0b710c6cb8dc8b36c6239b6c155731;hpb=7155f825daf90f4113ba3e8755eb51898b8e5736;p=friendica.git diff --git a/src/Console/DatabaseStructure.php b/src/Console/DatabaseStructure.php index b44400c01a..4d4125e88a 100644 --- a/src/Console/DatabaseStructure.php +++ b/src/Console/DatabaseStructure.php @@ -1,6 +1,6 @@ dba = $dba; - $this->configCache = $configCache; + $this->dbaDefinition = $dbaDefinition; + $this->viewDefinition = $viewDefinition; + $this->config = $config; + $this->basePath = $basePath->getPath(); } - protected function doExecute() + protected function doExecute(): int { if ($this->getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -102,7 +117,7 @@ HELP; throw new RuntimeException('Unable to connect to database'); } - $basePath = $this->configCache->get('system', 'basepath'); + $basePath = $this->config->get('system', 'basepath'); switch ($this->getArgument(0)) { case "dryrun": @@ -120,10 +135,9 @@ HELP; $output = ob_get_clean(); break; case "dumpsql": - DBStructure::writeStructure(); - ob_start(); - DBStructure::printStructure($basePath); - $output = ob_get_clean(); + DocWriter::writeDbDefinition($this->dbaDefinition, $this->basePath); + $output = DbaDefinitionSqlWriter::create($this->dbaDefinition); + $output .= ViewDefinitionSqlWriter::create($this->viewDefinition); break; case "toinnodb": ob_start();