]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Console/DatabaseStructure.php
Merge pull request #6611 from annando/worker-performance
[friendica.git] / src / Core / Console / DatabaseStructure.php
index f3badc1969062485aa758744d28834fe8f7daeee..1ec108d2e61cfd2f0d5d2fc07502b733ba3843b3 100644 (file)
@@ -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
  *
@@ -64,17 +61,19 @@ 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);
+                               $output = Update::run($a->getBasePath(), $force, true, false);
                                break;
                        case "dumpsql":
                                ob_start();
-                               DBStructure::printStructure();
+                               DBStructure::printStructure($a->getBasePath());
                                $output = ob_get_clean();
                                break;
                        case "toinnodb":
@@ -82,6 +81,8 @@ HELP;
                                DBStructure::convertToInnoDB();
                                $output = ob_get_clean();
                                break;
+                       default:
+                               $output = 'Unknown command: ' . $this->getArgument(0);
                }
 
                $this->out($output);