]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Summary.php
Further unused tables to be dropped
[friendica.git] / src / Module / Admin / Summary.php
index c19b7f7f87f7ff1e004ca09c6841775abf12228a..8aba391c8e4dc4d415a79d2464c4f9d6c649d733 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,12 +31,9 @@ use Friendica\Database\DBStructure;
 use Friendica\DI;
 use Friendica\Model\Register;
 use Friendica\Module\BaseAdmin;
-use Friendica\Module\Update\Profile;
 use Friendica\Network\HTTPException\InternalServerErrorException;
-use Friendica\Render\FriendicaSmarty;
 use Friendica\Util\ConfigFileLoader;
 use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Network;
 
 class Summary extends BaseAdmin
 {
@@ -66,12 +63,14 @@ class Summary extends BaseAdmin
                }
 
                // Avoid the database error 1615 "Prepared statement needs to be re-prepared", see https://github.com/friendica/friendica/issues/8550
-               $table_definition_cache = DBA::getVariable('table_definition_cache');
-               $table_open_cache = DBA::getVariable('table_open_cache');
-               if (!empty($table_definition_cache) && !empty($table_open_cache)) {
-                       $suggested_definition_cache = min(400 + round($table_open_cache / 2, 1), 2000);
-                       if ($suggested_definition_cache > $table_definition_cache) {
-                               $warningtext[] = DI::l10n()->t('Your table_definition_cache is too low (%d). This can lead to the database error "Prepared statement needs to be re-prepared". Please set it at least to %d (or -1 for autosizing). See <a href="%s">here</a> for more information.<br />', $table_definition_cache, $suggested_definition_cache, 'https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_definition_cache');
+               if (!DI::config()->get('database', 'pdo_emulate_prepares')) {
+                       $table_definition_cache = DBA::getVariable('table_definition_cache');
+                       $table_open_cache = DBA::getVariable('table_open_cache');
+                       if (!empty($table_definition_cache) && !empty($table_open_cache)) {
+                               $suggested_definition_cache = min(400 + round($table_open_cache / 2, 1), 2000);
+                               if ($suggested_definition_cache > $table_definition_cache) {
+                                       $warningtext[] = DI::l10n()->t('Your table_definition_cache is too low (%d). This can lead to the database error "Prepared statement needs to be re-prepared". Please set it at least to %d. See <a href="%s">here</a> for more information.<br />', $table_definition_cache, $suggested_definition_cache, 'https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_definition_cache');
+                               }
                        }
                }
 
@@ -85,7 +84,7 @@ class Summary extends BaseAdmin
                }
 
                if (DI::config()->get('system', 'dbupdate', DBStructure::UPDATE_NOT_CHECKED) == DBStructure::UPDATE_NOT_CHECKED) {
-                       DBStructure::update($a->getBasePath(), false, true);
+                       DBStructure::performUpdate();
                }
 
                if (DI::config()->get('system', 'dbupdate') == DBStructure::UPDATE_FAILED) {
@@ -249,7 +248,7 @@ class Summary extends BaseAdmin
        private static function checkSelfHostMeta()
        {
                // Fetch the host-meta to check if this really is a vital server
-               return Network::curl(DI::baseUrl()->get() . '/.well-known/host-meta')->isSuccess();
+               return DI::httpRequest()->get(DI::baseUrl()->get() . '/.well-known/host-meta')->isSuccess();
        }
 
 }