]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Update.php
Merge pull request #8055 from nupplaphil/task/remove_get_server
[friendica.git] / src / Core / Update.php
index 328938fe1c6b35b17a84ad4a8f4ba77307e80203..0ead704c101671faa77b9c17fd95122e0df88d2e 100644 (file)
@@ -27,9 +27,6 @@ class Update
                        return;
                }
 
-               // Check if the config files are set correctly
-               self::checkBaseSettings($_SERVER);
-
                // Don't check the status if the last update was failed
                if (Config::get('system', 'update', Update::SUCCESS, true) == Update::FAILED) {
                        return;
@@ -225,11 +222,6 @@ class Update
                }
        }
 
-       public static function checkBaseSettings(array $server)
-       {
-
-       }
-
        /**
         * send the email and do what is needed to do on update fails
         *
@@ -260,26 +252,25 @@ class Update
                        $sent[] = $admin['email'];
 
                        $lang = (($admin['language'])?$admin['language']:'en');
-                       L10n::pushLang($lang);
+                       $l10n = L10n::withLang($lang);
 
-                       $preamble = Strings::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
                                friendica developer if you can not help me on your own. My database might be invalid.",
                                $update_id));
-                       $body = L10n::t("The error message is\n[pre]%s[/pre]", $error_message);
+                       $body = $l10n->t("The error message is\n[pre]%s[/pre]", $error_message);
 
                        notification([
                                        'uid'      => $admin['uid'],
                                        'type'     => SYSTEM_EMAIL,
                                        'to_email' => $admin['email'],
-                                       'subject'  => l10n::t('[Friendica Notify] Database update'),
+                                       'subject'  => $l10n->t('[Friendica Notify] Database update'),
                                        'preamble' => $preamble,
                                        'body'     => $body,
                                        'language' => $lang]
                        );
-                       L10n::popLang();
                }
 
                //try the logger
@@ -303,9 +294,9 @@ class Update
                                $sent[] = $admin['email'];
 
                                $lang = (($admin['language']) ? $admin['language'] : 'en');
-                               L10n::pushLang($lang);
+                               $l10n = L10n::withLang($lang);
 
-                               $preamble = Strings::deindent(L10n::t("
+                               $preamble = Strings::deindent($l10n->t("
                                        The friendica database was successfully updated from %s to %s.",
                                        $from_build, $to_build));
 
@@ -313,11 +304,11 @@ class Update
                                                'uid' => $admin['uid'],
                                                'type' => SYSTEM_EMAIL,
                                                'to_email' => $admin['email'],
+                                               'subject'  => l10n::t('[Friendica Notify] Database update'),
                                                'preamble' => $preamble,
                                                'body' => $preamble,
                                                'language' => $lang]
                                );
-                               L10n::popLang();
                        }
                }