X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FAdmin%2FSummary.php;h=c232b5be5a3a51703c1f1bec5d3c055ee81ee2b1;hb=1792046a4f270f15d904d591c1e9eb0444ff2349;hp=7e3505e7ad4f83570d1ff453cb44ced36c7fadfb;hpb=0e05ff68686270d87447c570e28543a5bcc7e755;p=friendica.git diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index 7e3505e7ad..c232b5be5a 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -34,7 +34,6 @@ use Friendica\Module\BaseAdmin; use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Util\ConfigFileLoader; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Network; class Summary extends BaseAdmin { @@ -46,12 +45,35 @@ class Summary extends BaseAdmin // are there MyISAM tables in the DB? If so, trigger a warning message $warningtext = []; + + $templateEngine = Renderer::getTemplateEngine(); + $errors = []; + $templateEngine->testInstall($errors); + foreach ($errors as $error) { + $warningtext[] = DI::l10n()->t('Template engine (%s) error: %s', $templateEngine::$name, $error); + } + if (DBA::count(['information_schema' => 'tables'], ['engine' => 'myisam', 'table_schema' => DBA::databaseName()])) { $warningtext[] = DI::l10n()->t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See here for a guide that may be helpful converting the table engines. You may also use the command php bin/console.php dbstructure toinnodb of your Friendica installation for an automatic conversion.
', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html'); } - // Check if github.com/friendica/master/VERSION is higher then - // the local version of Friendica. Check is opt-in, source may be master or devel branch + // are there InnoDB tables in Antelope in the DB? If so, trigger a warning message + if (DBA::count(['information_schema' => 'tables'], ['ENGINE' => 'InnoDB', 'ROW_FORMAT' => ['COMPACT', 'REDUNDANT'], 'table_schema' => DBA::databaseName()])) { + $warningtext[] = DI::l10n()->t('Your DB still runs with InnoDB tables in the Antelope file format. You should change the file format to Barracuda. Friendica is using features that are not provided by the Antelope format. See here for a guide that may be helpful converting the table engines. You may also use the command php bin/console.php dbstructure toinnodb of your Friendica installation for an automatic conversion.
', 'https://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html'); + } + + // 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 here for more information.
', $table_definition_cache, $suggested_definition_cache, 'https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_definition_cache'); + } + } + + // Check if github.com/friendica/stable/VERSION is higher then + // the local version of Friendica. Check is opt-in, source may be stable or develop branch if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') { $gitversion = DI::config()->get('system', 'git_friendica_version'); if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) { @@ -60,7 +82,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) { @@ -121,7 +143,6 @@ class Summary extends BaseAdmin throw new InternalServerErrorException('Stream is null.'); } } - } catch (\Throwable $exception) { $warningtext[] = DI::l10n()->t('The debug logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage()); } @@ -178,7 +199,7 @@ class Summary extends BaseAdmin } DBA::close($pageFlagsCountStmt); - Logger::log('accounts: ' . print_r($accounts, true), Logger::DATA); + Logger::debug('accounts', ['accounts' => $accounts]); $pending = Register::getPendingCount(); @@ -225,7 +246,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(); } }