X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FDatabaseStructure.php;h=4d4125e88a7d6cf2f9de7f919221caa7feb64fc0;hb=e659a0314086dd700dbe5e754e383ab758725805;hp=c6d708eb71dfd9eb41e6c6b69cab0c0563fbd625;hpb=38a5358bfa646ae13a4a1a385741890fa88d9b7f;p=friendica.git diff --git a/src/Console/DatabaseStructure.php b/src/Console/DatabaseStructure.php index c6d708eb71..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,9 +135,9 @@ HELP; $output = ob_get_clean(); break; case "dumpsql": - 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();