X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConsole%2FDatabaseStructure.php;h=dededa9b3a4321e09fcd3ea31ea6d07c6f026b07;hb=efe358c617d18740b63cd0dcb1ee23591fcb0e2d;hp=f3badc1969062485aa758744d28834fe8f7daeee;hpb=8a46c786f37550160d81e7b7ecbcacb4c9fff493;p=friendica.git diff --git a/src/Core/Console/DatabaseStructure.php b/src/Core/Console/DatabaseStructure.php index f3badc1969..dededa9b3a 100644 --- a/src/Core/Console/DatabaseStructure.php +++ b/src/Core/Console/DatabaseStructure.php @@ -8,9 +8,6 @@ use Friendica\Database\DBA; use Friendica\Database\DBStructure; use RuntimeException; -require_once 'boot.php'; -require_once 'include/dba.php'; - /** * @brief Performs database updates from the command line * @@ -34,9 +31,10 @@ Commands toinnodb Convert all tables from MyISAM to InnoDB Options - -h|--help|-? Show help information - -v Show more debug information. - -f|--force Force the command in case of "update" (Ignore failed updates/running updates) + -h|--help|-? Show help information + -v Show more debug information. + -f|--force Force the update command (Even if the database structure matches) + -o|--override Override running or stalling updates HELP; return $help; } @@ -64,17 +62,20 @@ HELP; Core\Config::load(); + $a = get_app(); + switch ($this->getArgument(0)) { case "dryrun": - $output = DBStructure::update(true, false); + $output = DBStructure::update($a->getBasePath(), true, false); break; case "update": - $force = $this->getOption(['f', 'force'], false); - $output = Update::run($force, true, false); + $force = $this->getOption(['f', 'force'], false); + $override = $this->getOption(['o', 'override'], false); + $output = Update::run($a->getBasePath(), $force, $override,true, false); break; case "dumpsql": ob_start(); - DBStructure::printStructure(); + DBStructure::printStructure($a->getBasePath()); $output = ob_get_clean(); break; case "toinnodb": @@ -82,11 +83,12 @@ HELP; DBStructure::convertToInnoDB(); $output = ob_get_clean(); break; + default: + $output = 'Unknown command: ' . $this->getArgument(0); } $this->out($output); return 0; } - }