• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/index/internals/phrasefts.php
  • Класс: BitrixTranslateIndexInternalsPhraseFts
  • Вызов: PhraseFts::checkTables
static function checkTables(): void
{
	$tables = [];
	$tablesRes = Application::getConnection()->query("SHOW TABLES LIKE 'b_translate_phrase_fts_%'");
	while ($row = $tablesRes->fetch())
	{
		$tableName = array_shift($row);
		$langId = substr($tableName, -2);
		$tables[$langId] = $tableName;
	}
	foreach (TranslateConfig::getLanguages() as $langId)
	{
		if (!preg_match("/[a-z]{2}/i", $langId))
		{
			continue;
		}
		if (!isset($tables[$langId]))
		{
			self::createTable($langId);
		}
		else
		{
			unset($tables[$langId]);
		}
	}
	foreach ($tables as $langId => $table)
	{
		self::dropTable($langId);
	}
}