]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Update.php
Merge pull request #6280 from MrPetovan/bug/4738-fix-message-list-query
[friendica.git] / src / Core / Update.php
index 13968833576bdc4910dc8210fa6541f86a002354..7b2624cb9c638ae67eda5cd7c73c0c1cc840d8ab 100644 (file)
@@ -4,6 +4,7 @@ namespace Friendica\Core;
 
 use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
+use Friendica\Util\Strings;
 
 class Update
 {
@@ -17,6 +18,10 @@ class Update
         */
        public static function check($via_worker)
        {
+               if (!DBA::connected()) {
+                       return;
+               }
+
                $build = Config::get('system', 'build');
 
                if (empty($build)) {
@@ -117,6 +122,8 @@ class Update
                                        Lock::release('dbupdate');
                                }
                        }
+               } elseif ($force) {
+                       DBStructure::update($verbose, true);
                }
 
                return '';
@@ -209,7 +216,7 @@ class Update
                        $lang = (($admin['language'])?$admin['language']:'en');
                        L10n::pushLang($lang);
 
-                       $preamble = deindent(L10n::t("
+                       $preamble = Strings::deindent(L10n::t("
                                The friendica developers released update %s recently,
                                but when I tried to install it, something went terribly wrong.
                                This needs to be fixed soon and I can't do it alone. Please contact a
@@ -244,7 +251,7 @@ class Update
                                $lang = (($admin['language']) ? $admin['language'] : 'en');
                                L10n::pushLang($lang);
 
-                               $preamble = deindent(L10n::t("
+                               $preamble = Strings::deindent(L10n::t("
                                        The friendica database was successfully updated from %s to %s.",
                                        $from_build, $to_build));