From ae1fd8605beeba772391cea28cef0348bbba2195 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 22 Jun 2024 14:08:12 +0200 Subject: [PATCH] =?utf8?q?Remove=20files=20for=20the=20upgrade=205.5=20?= =?utf8?q?=E2=86=92=206.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../acp/update_com.woltlab.wcf_6.0.3.php | 29 --- ...ate_com.woltlab.wcf_6.0_articleOrphans.php | 31 ---- ...woltlab.wcf_6.0_checkAttachmentStorage.php | 27 --- .../update_com.woltlab.wcf_6.0_checkCache.php | 21 --- ...ltlab.wcf_6.0_checkForMultiDomainSetup.php | 17 -- ...oltlab.wcf_6.0_checkSystemRequirements.php | 76 -------- ...com.woltlab.wcf_6.0_checkUpdateServers.php | 39 ---- .../update_com.woltlab.wcf_6.0_favicon.php | 47 ----- ...date_com.woltlab.wcf_6.0_initBootstrap.php | 30 --- ...update_com.woltlab.wcf_6.0_landingPage.php | 39 ---- .../update_com.woltlab.wcf_6.0_license.php | 36 ---- ..._com.woltlab.wcf_6.0_reaction_fk_step1.php | 41 ---- ...tlab.wcf_6.0_removeDownloadedGravatars.php | 33 ---- ....woltlab.wcf_6.0_removeLegacyAppConfig.php | 29 --- ...com.woltlab.wcf_6.0_skipFirstTimeSetup.php | 23 --- ...ate_com.woltlab.wcf_6.0_styleVariables.php | 175 ------------------ .../update_com.woltlab.wcf_6.0_trophies.php | 59 ------ 17 files changed, 752 deletions(-) delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0.3.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_articleOrphans.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkAttachmentStorage.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkCache.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkForMultiDomainSetup.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkSystemRequirements.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkUpdateServers.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_favicon.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_initBootstrap.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_landingPage.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_license.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_reaction_fk_step1.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeDownloadedGravatars.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeLegacyAppConfig.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_skipFirstTimeSetup.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_styleVariables.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_trophies.php diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0.3.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0.3.php deleted file mode 100644 index a8c42e0b4b..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0.3.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ - -use wcf\system\WCF; - -// Fix the default value for style variables. -$sql = "UPDATE wcf1_style_variable - SET defaultValueDarkMode = ? - WHERE variableName = ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([null, 'individualScssDarkMode']); - -// Fixes any bad values stored for existing styles. -$sql = "UPDATE wcf1_style_variable_value - SET variableValueDarkMode = ? - WHERE variableID = ( - SELECT variableID - FROM wcf1_style_variable - WHERE variableName = ? - )"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([null, 'individualScssDarkMode']); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_articleOrphans.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_articleOrphans.php deleted file mode 100644 index f036ed83c3..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_articleOrphans.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ - -use wcf\data\article\ArticleAction; -use wcf\system\package\SplitNodeException; -use wcf\system\WCF; - -$sql = "SELECT articleID - FROM wcf1_article - WHERE categoryID IS NULL"; -$statement = WCF::getDB()->prepare($sql, 50); -$statement->execute(); -$articleIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); - -if ($articleIDs === []) { - return; -} - -$articleAction = new ArticleAction($articleIDs, 'delete'); -$articleAction->executeAction(); - -// Repeat the deletion if any article was deleted. If no deletable articles -// remain, the script will abort further above. -throw new SplitNodeException(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkAttachmentStorage.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkAttachmentStorage.php deleted file mode 100644 index b036f51074..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkAttachmentStorage.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -use wcf\system\WCF; - -if (\defined('ATTACHMENT_STORAGE') && ATTACHMENT_STORAGE) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = \sprintf( - "Die Unterstützung für einen alternativen Speicherort von Dateianhängen wird mit dem Upgrade entfernt. Es ist notwendig die Dateianhänge in das Standardverzeichnis '%s' zu verschieben und anschließend die PHP-Konstante 'ATTACHMENT_STORAGE' zu entfernen.", - WCF_DIR . 'attachments/' - ); - } else { - $message = \sprintf( - "The support for an alternative attachment storage location will be removed during the upgrade. It is required to move the attachments into the default directory '%s' and then to remove the PHP constant 'ATTACHMENT_STORAGE'.", - WCF_DIR . 'attachments/' - ); - } - - throw new \RuntimeException($message); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkCache.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkCache.php deleted file mode 100644 index 5e5cc861aa..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkCache.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ - -use wcf\system\WCF; - -if (CACHE_SOURCE_TYPE === 'memcached') { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Die Unterstützung für Memcached wird mit dem Upgrade entfernt. Es ist notwendig, auf einen anderen Cache umzustellen."; - } else { - $message = "The support for Memcached will be removed during the upgrade. It is required to configure a different cache."; - } - - throw new \RuntimeException($message); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkForMultiDomainSetup.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkForMultiDomainSetup.php deleted file mode 100644 index 4d51aa4b27..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkForMultiDomainSetup.php +++ /dev/null @@ -1,17 +0,0 @@ -getApplicationByID(1)->domainName; -foreach (ApplicationHandler::getInstance()->getApplications() as $application) { - if ($application->domainName !== $domainName) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Die installierten Apps befinden sich auf unterschiedlichen Domains."; - } else { - $message = "The installed apps are running on different domains."; - } - - throw new \RuntimeException($message); - } -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkSystemRequirements.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkSystemRequirements.php deleted file mode 100644 index 456b31019b..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkSystemRequirements.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ - -use wcf\system\WCF; - -$phpVersion = \PHP_VERSION; -$neededPhpVersion = '8.1.2'; -if (!\version_compare($phpVersion, $neededPhpVersion, '>=')) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Ihre PHP-Version '{$phpVersion}' ist unzureichend für die Installation dieser Software. PHP-Version {$neededPhpVersion} oder höher wird benötigt."; - } else { - $message = "Your PHP version '{$phpVersion}' is insufficient for installation of this software. PHP version {$neededPhpVersion} or greater is required."; - } - - throw new \RuntimeException($message); -} - -if (\PHP_INT_SIZE != 8) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Die eingesetzte PHP-Version muss 64-Bit-Ganzzahlen unterstützen."; - } else { - $message = "The PHP version must support 64-bit integers."; - } - - throw new \RuntimeException($message); -} - -if (!\extension_loaded('intl')) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Die 'intl' PHP-Erweiterung muss aktiv sein."; - } else { - $message = "The 'intl' PHP extension needs to be enabled."; - } - - throw new \RuntimeException($message); -} - -$sqlVersion = WCF::getDB()->getVersion(); -$compareSQLVersion = \preg_replace('/^(\d+\.\d+\.\d+).*$/', '\\1', $sqlVersion); -if (\stripos($sqlVersion, 'MariaDB') !== false) { - $neededSqlVersion = '10.5.15'; - $sqlFork = 'MariaDB'; -} else { - $sqlFork = 'MySQL'; - $neededSqlVersion = '8.0.30'; -} - -if (!\version_compare($compareSQLVersion, $neededSqlVersion, '>=')) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Ihre {$sqlFork}-Version '{$sqlVersion}' ist unzureichend für die Installation dieser Software. {$sqlFork}-Version {$neededSqlVersion} oder höher wird benötigt."; - } else { - $message = "Your {$sqlFork} version '{$sqlVersion}' is insufficient for installation of this software. {$sqlFork} version {$neededSqlVersion} or greater is required."; - } - - throw new \RuntimeException($message); -} - -$sql = "SELECT 1"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(); -if ($statement->fetchSingleColumn() !== 1) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Für die Kommunikation mit dem MySQL-Server muss PHPs MySQL Native Driver verwendet werden."; - } else { - $message = "PHP's MySQL Native Driver must be used for communication with the MySQL server."; - } - - throw new \RuntimeException($message); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkUpdateServers.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkUpdateServers.php deleted file mode 100644 index 74f92ba3dd..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_checkUpdateServers.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - -use Laminas\Diactoros\Uri; -use wcf\data\package\update\server\PackageUpdateServerList; -use wcf\system\WCF; - -$list = new PackageUpdateServerList(); -$list->readObjects(); - -foreach ($list as $server) { - $uri = new Uri($server->serverURL); - - if ($uri->getScheme() !== 'https') { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Der Paketserver '{$uri}' verwendet das unverschlüsselte http-Protokoll."; - } else { - $message = "The package server '{$uri}' uses the unencrypted 'http' scheme."; - } - - throw new \RuntimeException($message); - } - if ($uri->getPort()) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Der Paketserver '{$uri}' verwendet nicht den Standard-Port."; - } else { - $message = "The package server '{$uri}' uses a non-standard port."; - } - - throw new \RuntimeException($message); - } -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_favicon.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_favicon.php deleted file mode 100644 index c3c04bcc49..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_favicon.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ - -use wcf\data\style\StyleEditor; -use wcf\data\style\StyleList; -use wcf\system\image\ImageHandler; - -$styleList = new StyleList(); -$styleList->readObjects(); - -$images = [ - 'favicon-48x48.png' => 48, - 'android-chrome-192x192.png' => 192, - 'android-chrome-256x256.png' => 256, - 'apple-touch-icon.png' => 180, - 'mstile-150x150.png' => 150, -]; - -foreach ($styleList as $style) { - $style->loadVariables(); - $variables = $style->getVariables(); - $styleEditor = new StyleEditor($style); - - foreach (['png', 'jpg', 'gif'] as $extension) { - $templatePath = $style->getAssetPath() . "favicon-template." . $extension; - if (\file_exists($templatePath)) { - $adapter = ImageHandler::getInstance()->getAdapter(); - $adapter->loadFile($templatePath); - - foreach ($images as $filename => $length) { - $thumbnail = $adapter->createThumbnail($length, $length); - $adapter->writeImage($thumbnail, $style->getAssetPath() . $filename); - // Clear thumbnail as soon as possible to free up the memory. - $thumbnail = null; - } - - break; - } - } -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_initBootstrap.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_initBootstrap.php deleted file mode 100644 index 9bce40dded..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_initBootstrap.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ - -namespace wcf\acp; - -use wcf\system\io\AtomicWriter; - -// Variable taken from 'WCF::BOOTSTRAP_LOADER' which is not defined yet. -$BOOTSTRAP_LOADER = \WCF_DIR . '/lib/bootstrap.php'; - -if (\file_exists($BOOTSTRAP_LOADER)) { - return; -} - -$writer = new AtomicWriter($BOOTSTRAP_LOADER); -$writer->write( - <<<'EOT' - flush(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_landingPage.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_landingPage.php deleted file mode 100644 index b0b2f7b6a6..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_landingPage.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - -use wcf\system\WCF; - -$columns = \array_map( - strtolower(...), - \array_column( - WCF::getDB()->getEditor()->getColumns('wcf' . WCF_N . '_page'), - 'name' - ) -); - -if (\in_array('islandingpage', $columns)) { - $sql = "SELECT pageID - FROM wcf1_page - WHERE isLandingPage = ?"; - $statement = WCF::getDB()->prepare($sql); - $statement->execute([ - 1, - ]); - $landingPageID = $statement->fetchSingleColumn(); - - $sql = "UPDATE wcf1_application - SET landingPageID = ? - WHERE packageID = ?"; - $statement = WCF::getDB()->prepare($sql); - $statement->execute([ - $landingPageID ?: null, - 1, - ]); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_license.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_license.php deleted file mode 100644 index a208a82431..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_license.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - -use wcf\data\package\update\server\PackageUpdateServer; -use wcf\data\package\update\server\PackageUpdateServerEditor; -use wcf\system\package\license\LicenseApi; - -try { - $licenseApi = new LicenseApi(); - $licenseData = $licenseApi->fetchFromRemote(); - $licenseApi->updateLicenseFile($licenseData); - - // If we’re still here it means that the credentials are actually valid. Now - // we can check if the credentials for both servers are in sync, because - // traditionally users could use their account credentials to authenticate. - $updateServer = PackageUpdateServer::getWoltLabUpdateServer(); - $storeServer = PackageUpdateServer::getPluginStoreServer(); - - if ($updateServer->getAuthData() !== $storeServer->getAuthData()) { - $authData = $updateServer->getAuthData(); - - (new PackageUpdateServerEditor($storeServer))->update([ - 'username' => $authData['username'], - 'password' => $authData['password'], - ]); - } -} catch (\Throwable) { - // This action must be silent, failing to execute is not an issue here. -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_reaction_fk_step1.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_reaction_fk_step1.php deleted file mode 100644 index d521442403..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_reaction_fk_step1.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ - -use wcf\system\WCF; - -$databaseEditor = WCF::getDB()->getEditor(); -$tableName = 'wcf' . WCF_N . '_like'; -foreach ($databaseEditor->getForeignKeys($tableName) as $foreignKey => $columnData) { - if ($columnData['columns'] !== ['reactionTypeID']) { - continue; - } - - if ($columnData['referencedColumns'] !== ['reactionTypeID']) { - continue; - } - - if ($columnData['referencedTable'] !== 'wcf' . WCF_N . '_reaction_type') { - continue; - } - - $databaseEditor->dropForeignKey($tableName, $foreignKey); - - $sql = "DELETE FROM wcf1_package_installation_sql_log - WHERE sqlTable = ? - AND sqlIndex = ?"; - $statement = WCF::getDB()->prepare($sql); - $statement->execute([ - $tableName, - $foreignKey, - ]); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeDownloadedGravatars.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeDownloadedGravatars.php deleted file mode 100644 index 436b2e1383..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeDownloadedGravatars.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ - -use wcf\system\package\SplitNodeException; - -if (!\is_dir(WCF_DIR . 'images/avatars/gravatars/')) { - return; -} - -$deleted = 0; -foreach (new \DirectoryIterator(WCF_DIR . 'images/avatars/gravatars/') as $fileInfo) { - if (!$fileInfo->isFile()) { - continue; - } - - if (!\preg_match('/^[0-9a-f]{32}-[0-9]+\.(png|gif|jpe?g)$/', $fileInfo->getBasename())) { - continue; - } - - \unlink($fileInfo->getPathname()); - $deleted++; - - if ($deleted > 500) { - throw new SplitNodeException(); - } -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeLegacyAppConfig.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeLegacyAppConfig.php deleted file mode 100644 index d402617f5e..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_removeLegacyAppConfig.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ - -use wcf\data\application\ApplicationList; -use wcf\util\FileUtil; - -$list = new ApplicationList(); -$list->readObjects(); - -foreach ($list as $application) { - $package = $application->getPackage(); - - if ($package->package === 'com.woltlab.wcf') { - continue; - } - - $legacyConfig = FileUtil::addTrailingSlash(WCF_DIR . $package->packageDir) . 'config.inc.php'; - - if (\file_exists($legacyConfig) && \md5_file($legacyConfig) === 'e13ffdb5262e68a066d2486e468df685') { - \unlink($legacyConfig); - } -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_skipFirstTimeSetup.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_skipFirstTimeSetup.php deleted file mode 100644 index 1a281a153b..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_skipFirstTimeSetup.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ - -use wcf\data\option\Option; -use wcf\data\option\OptionAction; - -$objectAction = new OptionAction( - [], - 'updateAll', - [ - 'data' => [ - Option::getOptionByName('first_time_setup_state')->optionID => -1, - ], - ] -); -$objectAction->executeAction(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_styleVariables.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_styleVariables.php deleted file mode 100644 index 01cf73a17f..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_styleVariables.php +++ /dev/null @@ -1,175 +0,0 @@ -prepare($sql); - -foreach ($styleVariables as $data) { - [$variableName, $defaultValue, $defaultValueDarkMode] = $data; - - $statement->execute([ - $variableName, - $defaultValue, - $defaultValueDarkMode, - ]); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_trophies.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_trophies.php deleted file mode 100644 index 58682bf2f8..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_trophies.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ - -use wcf\data\trophy\Trophy; -use wcf\data\trophy\TrophyCache; -use wcf\system\style\exception\UnknownIcon; -use wcf\system\style\FontAwesomeIcon; -use wcf\system\WCF; - -WCF::getDB()->beginTransaction(); - -$sql = "SELECT trophyID, iconName - FROM wcf1_trophy - WHERE type = ? - AND iconName IS NOT NULL - AND iconName <> ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([ - Trophy::TYPE_BADGE, - '[]', -]); -$iconData = $statement->fetchMap('trophyID', 'iconName'); - -$sql = "UPDATE wcf1_trophy - SET iconName = ? - WHERE trophyID = ?"; -$statement = WCF::getDB()->prepare($sql); -foreach ($iconData as $trophyID => $oldIconName) { - // No modification if the icon already contains a semicolon - // (implying it already was migrated). - if (\str_contains($oldIconName, ';')) { - continue; - } - - try { - $newIconName = FontAwesomeIcon::mapVersion4($oldIconName); - } catch (UnknownIcon $e) { - // If the old icon is unknown we replace it with a placeholder. - \wcf\functions\exception\logThrowable($e); - - $newIconName = FontAwesomeIcon::fromString('trophy;false')->__toString(); - } - - $statement->execute([ - $newIconName, - $trophyID, - ]); -} - -WCF::getDB()->commitTransaction(); - -TrophyCache::getInstance()->clearCache(); -- 2.20.1