From 4457208e67401c0d56aa37ca9624392fb6017ac1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 11 May 2022 11:40:37 +0200 Subject: [PATCH] Drop obsolete upgrade instructions from 5.4 to 5.5 --- com.woltlab.wcf/objectType.xml | 5 - com.woltlab.wcf/option.xml | 10 -- com.woltlab.wcf/userOption.xml | 4 - .../database/update_com.woltlab.wcf_5.5.php | 51 --------- ...date_com.woltlab.wcf_5.5_boxConditions.php | 52 --------- ...oltlab.wcf_5.5_cleanupPackageExclusion.php | 24 ----- ...ltlab.wcf_5.5_clearPackageDeprecations.php | 26 ----- ...com.woltlab.wcf_5.5_ensureInnoDbSearch.php | 33 ------ ...e_com.woltlab.wcf_5.5_normalizeFileLog.php | 43 -------- ...com.woltlab.wcf_5.5_randomize_cronjobs.php | 56 ---------- .../update_com.woltlab.wcf_5.5_starttls.php | 100 ------------------ ...ate_com.woltlab.wcf_5.5_styleVariables.php | 30 ------ wcfsetup/install/lang/de.xml | 55 ---------- wcfsetup/install/lang/en.xml | 55 ---------- 14 files changed, 544 deletions(-) delete mode 100644 wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_boxConditions.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageDeprecations.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_normalizeFileLog.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_randomize_cronjobs.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_starttls.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_styleVariables.php diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 64489461c9..2ae3e89c62 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -1827,9 +1827,4 @@ - - - com.woltlab.wcf.rebuildData - - diff --git a/com.woltlab.wcf/option.xml b/com.woltlab.wcf/option.xml index 361692e213..2b849b4a5c 100644 --- a/com.woltlab.wcf/option.xml +++ b/com.woltlab.wcf/option.xml @@ -1666,14 +1666,4 @@ DESC:wcf.global.sortOrder.descending - - diff --git a/com.woltlab.wcf/userOption.xml b/com.woltlab.wcf/userOption.xml index 15b458ca40..549330a9b6 100644 --- a/com.woltlab.wcf/userOption.xml +++ b/com.woltlab.wcf/userOption.xml @@ -246,8 +246,4 @@ - - - diff --git a/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php deleted file mode 100644 index 951c4403ba..0000000000 --- a/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\database\table\column\DefaultFalseBooleanDatabaseTableColumn; -use wcf\system\database\table\column\EnumDatabaseTableColumn; -use wcf\system\database\table\column\SmallintDatabaseTableColumn; -use wcf\system\database\table\index\DatabaseTableIndex; -use wcf\system\database\table\PartialDatabaseTable; - -return [ - PartialDatabaseTable::create('wcf1_article') - ->columns([ - SmallintDatabaseTableColumn::create('comments') - ->drop(), - ]), - PartialDatabaseTable::create('wcf1_article_content') - ->columns([ - SmallintDatabaseTableColumn::create('comments') - ->length(5) - ->notNull() - ->defaultValue(0), - ]), - PartialDatabaseTable::create('wcf1_blacklist_entry') - ->indices([ - DatabaseTableIndex::create('lastSeen') - ->columns(['lastSeen']), - ]), - PartialDatabaseTable::create('wcf1_comment') - ->columns([ - DefaultFalseBooleanDatabaseTableColumn::create('hasEmbeddedObjects'), - ]), - PartialDatabaseTable::create('wcf1_comment_response') - ->columns([ - DefaultFalseBooleanDatabaseTableColumn::create('hasEmbeddedObjects'), - ]), - PartialDatabaseTable::create('wcf1_style') - ->columns([ - EnumDatabaseTableColumn::create('apiVersion') - ->enumValues(['3.0', '3.1', '5.2', '5.5']) - ->notNull() - ->defaultValue('3.0'), - ]), -]; diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_boxConditions.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_boxConditions.php deleted file mode 100644 index 8681cc79a2..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_boxConditions.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\data\box\Box; -use wcf\data\box\BoxList; -use wcf\data\condition\Condition; -use wcf\data\object\type\ObjectTypeCache; -use wcf\system\condition\ConditionHandler; -use wcf\system\condition\page\MultiPageCondition; - -$boxList = new BoxList(); -$boxList->readObjects(); - -foreach ($boxList as $box) { - $conditions = ConditionHandler::getInstance()->getConditions( - Box::VISIBILITY_CONDITIONS_OBJECT_TYPE_NAME, - $box->boxID - ); - - if (!empty($conditions)) { - // The box already has conditions (maybe from a previous upgrade attempt). - // Skip this box to ensure, that the condition will not attached twice. - continue; - } - - $pageCondition = ObjectTypeCache::getInstance()->getObjectTypeByName( - Box::VISIBILITY_CONDITIONS_OBJECT_TYPE_NAME, - 'com.woltlab.wcf.page' - ); - - \assert($pageCondition->getProcessor() instanceof MultiPageCondition); - - $pageCondition->getProcessor()->setData(new Condition(null, [ - 'conditionData' => \serialize([ - 'pageIDs' => $box->getPageIDs(), - 'pageIDs_reverseLogic' => $box->visibleEverywhere, - ]), - ])); - - ConditionHandler::getInstance()->createConditions( - $box->boxID, - [$pageCondition] - ); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php deleted file mode 100644 index e12d961373..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_cleanupPackageExclusion.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\WCF; - -$sql = "UPDATE wcf1_package_exclusion - SET excludedPackageVersion = ? - WHERE excludedPackageVersion = ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([ - '*', - '', -]); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageDeprecations.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageDeprecations.php deleted file mode 100644 index 20d2c621bd..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageDeprecations.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\WCF; - -$sql = "DELETE FROM wcf1_package_compatibility"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute(); - -$sql = "DELETE FROM wcf1_package_update_compatibility"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute(); - -$sql = "DELETE FROM wcf1_package_update_optional"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php deleted file mode 100644 index 438253c965..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php +++ /dev/null @@ -1,33 +0,0 @@ -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; - -if ($nonInnoDbSearch) { - if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { - $message = "Es wurden noch nicht alle Tabellen auf InnoDB migriert."; - } else { - $message = "The migration to InnoDB was not yet performed for all database tables."; - } - - throw new \RuntimeException($message); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_normalizeFileLog.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_normalizeFileLog.php deleted file mode 100644 index 746d36a69f..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_normalizeFileLog.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\WCF; -use wcf\util\FileUtil; - -$sql = "SELECT * - FROM wcf1_package_installation_file_log - WHERE filename LIKE ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute(['./%']); - -$sql = "DELETE FROM wcf1_package_installation_file_log - WHERE packageID = ? - AND filename = ? - AND application = ?"; -$deleteStatement = WCF::getDB()->prepare($sql); - -$sql = "INSERT IGNORE INTO wcf1_package_installation_file_log - (packageID, filename, application) - VALUES (?, ?, ?)"; -$insertStatement = WCF::getDB()->prepare($sql); - -while ($row = $statement->fetchArray()) { - $deleteStatement->execute([ - $row['packageID'], - $row['filename'], - $row['application'], - ]); - $insertStatement->execute([ - $row['packageID'], - FileUtil::getRealPath($row['filename']), - $row['application'], - ]); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_randomize_cronjobs.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_randomize_cronjobs.php deleted file mode 100644 index 85addfc9ea..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_randomize_cronjobs.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\WCF; - -$startMinute = \random_int(0, 59); -$startHour = \random_int(0, 23); - -$sql = "UPDATE wcf1_cronjob - SET startMinute = ?, - startHour = ?, - startDom = ?, - startMonth = ?, - startDow = ?, - lastExec = ?, - nextExec = ?, - afterNextExec = ? - WHERE packageiD = ? - AND cronjobName = ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([ - $startMinute, - $startHour, - '*', - '*', - '*', - - 0, - \TIME_NOW, - 0, - - $this->installation->getPackageID(), - 'com.woltlab.wcf.refreshPackageUpdates', -]); -$statement->execute([ - $startMinute, - (($startHour + 12) % 24), - \random_int(1, 15), - '*', - '*', - - 0, - \TIME_NOW, - 0, - - $this->installation->getPackageID(), - 'com.woltlab.wcf.refreshSearchRobots', -]); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_starttls.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_starttls.php deleted file mode 100644 index 09d3731d52..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_starttls.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\data\option\OptionAction; -use wcf\system\email\Email; -use wcf\system\email\transport\exception\TransientFailure; -use wcf\system\io\RemoteFile; - -if (MAIL_SMTP_STARTTLS != 'may') { - return; -} - -$value = 'encrypt'; -if (\str_starts_with(MAIL_SMTP_HOST, 'ssl://')) { - // Anything using proper SSL can't use STARTTLS. - $value = 'none'; -} elseif (MAIL_SMTP_PORT == 465) { - // Anything on port 465 must be using proper SSL. - $value = 'none'; -} elseif (MAIL_SEND_METHOD == 'smtp') { - // For all the other configurations that use SMTP as the transport we - // need to verify whether TLS works or not. - - $getCode = static function (RemoteFile $connection) { - $code = null; - do { - $data = $connection->gets(); - if (\preg_match('/^(\d{3})([- ])(.*)$/', $data, $matches)) { - if ($code === null) { - $code = \intval($matches[1]); - } - - if ($code == $matches[1]) { - if ($matches[2] === ' ') { - return $code; - } - } else { - throw new TransientFailure("Unexpected reply '" . $data . "' from SMTP server. Code does not match previous codes from multiline answer."); - } - } else { - if ($connection->eof()) { - throw new TransientFailure("Unexpected EOF / connection close from SMTP server."); - } - - throw new TransientFailure("Unexpected reply '" . $data . "' from SMTP server."); - } - } while (true); - }; - - try { - $connection = new RemoteFile(MAIL_SMTP_HOST, MAIL_SMTP_PORT, 5); - $success = false; - if ($getCode($connection) == 220) { - $connection->write('EHLO ' . Email::getHost() . "\r\n"); - if ($getCode($connection) == 250) { - $connection->write("STARTTLS\r\n"); - if ($getCode($connection) == 220) { - if ($connection->setTLS(true)) { - $connection->write('EHLO ' . Email::getHost() . "\r\n"); - if ($getCode($connection) == 250) { - $success = true; - try { - $connection->write("QUIT\r\n"); - } catch (\Exception $e) { - // Ignore errors during disconnect. - } - } - } - } - } - } - - if (!$success) { - $value = 'none'; - } - } catch (\Exception $e) { - $value = 'none'; - } finally { - try { - $connection->close(); - } catch (\Exception $e) { - // Ignore errors during disconnect. - } - } -} - -$optionAction = new OptionAction([], 'import', [ - 'data' => [ - 'mail_smtp_starttls' => $value, - ], -]); -$optionAction->executeAction(); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_styleVariables.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_styleVariables.php deleted file mode 100644 index 4ccca35894..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_styleVariables.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\WCF; - -$values = [ - 'wcfUserMenuBackground' => 'rgba(255, 255, 255, 1)', - 'wcfUserMenuBackgroundActive' => 'rgba(239, 239, 239, 1)', - 'wcfUserMenuText' => 'rgba(58, 58, 61, 1)', - 'wcfUserMenuTextDimmed' => 'rgba(108, 108, 108, 1)', - 'wcfUserMenuIndicator' => 'rgba(49, 138, 220, 1)', - 'wcfUserMenuBorder' => 'rgba(221, 221, 221, 1)', -]; - -$sql = "INSERT IGNORE INTO wcf1_style_variable (variableName, defaultValue) VALUES (?, ?)"; -$statement = WCF::getDB()->prepare($sql); -foreach ($values as $variableName => $defaultValue) { - $statement->execute([ - $variableName, - $defaultValue, - ]); -} diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index f1c7916fae..600318f9f0 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -5564,59 +5564,4 @@ Benachrichtigungen auf {PAGE_TITLE|phra - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index a46592b2f2..8ccc9da5e7 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -5566,59 +5566,4 @@ your notifications on {PAGE_TITLE|phras - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- 2.20.1