From: Tim Düsterhus Date: Wed, 23 Dec 2020 11:50:35 +0000 (+0100) Subject: Check the search table engines on ACP's IndexPage X-Git-Tag: 5.4.0_Alpha_1~509^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ed686ab7d125f67495c442c2a0325f27b770091;p=GitHub%2FWoltLab%2FWCF.git Check the search table engines on ACP's IndexPage see #3404 --- diff --git a/wcfsetup/install/files/acp/templates/index.tpl b/wcfsetup/install/files/acp/templates/index.tpl index 6c7d8c8aef..90f2074015 100644 --- a/wcfsetup/install/files/acp/templates/index.tpl +++ b/wcfsetup/install/files/acp/templates/index.tpl @@ -23,6 +23,10 @@

{lang}wcf.acp.index.recaptchaWithoutKey{/lang}

{/if} +{if $nonInnoDbSearch} +

{lang}wcf.acp.index.nonInnoDbSearch{/lang}

+{/if} + {if !VISITOR_USE_TINY_BUILD}

{lang}wcf.acp.index.tinyBuild{/lang}

{/if} diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index abf2564d94..fdced3969b 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -2,6 +2,7 @@ namespace wcf\acp\page; use wcf\data\user\User; use wcf\data\devtools\missing\language\item\DevtoolsMissingLanguageItemList; +use wcf\data\object\type\ObjectTypeCache; use wcf\page\AbstractPage; use wcf\system\application\ApplicationHandler; use wcf\system\cache\builder\OptionCacheBuilder; @@ -9,6 +10,7 @@ use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\io\RemoteFile; use wcf\system\package\PackageInstallationDispatcher; use wcf\system\request\LinkHandler; +use wcf\system\search\SearchIndexManager; use wcf\system\WCF; /** @@ -100,6 +102,23 @@ class IndexPage extends AbstractPage { ); } + $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.searchableObjectType'); + $tableNames = []; + foreach ($objectTypes as $objectType) { + $tableNames[] = SearchIndexManager::getTableName($objectType->objectType); + } + $conditionBuilder = new PreparedStatementConditionBuilder(true); + $conditionBuilder->add('TABLE_NAME IN (?)', [$tableNames]); + $conditionBuilder->add('TABLE_SCHEMA = ?', [WCF::getDB()->getDatabaseName()]); + $conditionBuilder->add('ENGINE <> ?', ['InnoDB']); + + $sql = "SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + ". $conditionBuilder; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute($conditionBuilder->getParameters()); + $nonInnoDbSearch = $statement->fetchSingleColumn() > 0; + $evaluationExpired = $evaluationPending = []; foreach (ApplicationHandler::getInstance()->getApplications() as $application) { if ($application->getPackage()->package === 'com.woltlab.wcf') { @@ -148,6 +167,7 @@ class IndexPage extends AbstractPage { WCF::getTPL()->assign([ 'recaptchaWithoutKey' => $recaptchaWithoutKey, 'recaptchaKeyLink' => $recaptchaKeyLink, + 'nonInnoDbSearch' => $nonInnoDbSearch, 'server' => $this->server, 'usersAwaitingApproval' => $usersAwaitingApproval, 'evaluationExpired' => $evaluationExpired, diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 440005ea6f..7ad6aa850f 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -943,6 +943,7 @@ ACHTUNG: Die oben genannten Meldungen sind stark gekürzt. Sie können Details z zu aktivieren.]]>
Für eine weitere Nutzung {if LANGUAGE_USE_INFORMAL_VARIANT}musst du{else}müssen Sie{/if} einen Schlüssel in den Optionen hinterlegen, unterhalb des Eingabefeldes befindet sich eine Anleitung zum Anfordern des Schlüssels.]]>
Liste der fehlenden Texte für weitere Informationen.]]> + Systemüberprüfung.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index f7e0332f45..72f42ff92a 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -920,6 +920,7 @@ ATTENTION: The messages listed above are greatly shortened. You can view details enabling it.]]>
For further use you need to provide a key in your options, please follow the instructions below the input field to obtain a key.]]>
list of missing phrases for more information.]]> + System Check.]]>