From: Tim Düsterhus Date: Tue, 3 Aug 2021 10:00:26 +0000 (+0200) Subject: Do not store optional information from update servers within the database X-Git-Tag: 5.5.0_Alpha_1~507^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=51d00438eb1d6ca263bac3b97821d222f85913c0;p=GitHub%2FWoltLab%2FWCF.git Do not store optional information from update servers within the database These do not appear to be used anywhere and the official package servers do not expose them either, making them effectively empty even in current versions. see fd3511448663b86f4428e848bbefa07b93bf4bad see #4371 see #4385 --- diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageCompatibility.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageCompatibility.php deleted file mode 100644 index 389de518b5..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageCompatibility.php +++ /dev/null @@ -1,22 +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(); 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 new file mode 100644 index 0000000000..20d2c621bd --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageDeprecations.php @@ -0,0 +1,26 @@ + + * @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/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 6e4fb21167..d85eac39e9 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -524,7 +524,7 @@ class PackageUpdateDispatcher extends SingletonFactory */ protected function savePackageUpdates(array &$allNewPackages, $packageUpdateServerID) { - $excludedPackagesParameters = $optionalInserts = $requirementInserts = []; + $excludedPackagesParameters = $requirementInserts = []; $sql = "INSERT INTO wcf" . WCF_N . "_package_update (packageUpdateServerID, package, packageName, packageDescription, author, authorURL, isApplication, pluginStoreFileID) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; @@ -602,15 +602,6 @@ class PackageUpdateDispatcher extends SingletonFactory } } - if (isset($versionData['optionalPackages'])) { - foreach ($versionData['optionalPackages'] as $optionalPackage) { - $optionalInserts[] = [ - 'packageUpdateVersionID' => $packageUpdateVersionID, - 'package' => $optionalPackage, - ]; - } - } - if (isset($versionData['excludedPackages'])) { foreach ($versionData['excludedPackages'] as $excludedIdentifier => $exclusion) { $excludedPackagesParameters[] = [ @@ -680,21 +671,6 @@ class PackageUpdateDispatcher extends SingletonFactory WCF::getDB()->commitTransaction(); } - if (!empty($optionalInserts)) { - $sql = "INSERT INTO wcf" . WCF_N . "_package_update_optional - (packageUpdateVersionID, package) - VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); - WCF::getDB()->beginTransaction(); - foreach ($optionalInserts as $requirement) { - $statement->execute([ - $requirement['packageUpdateVersionID'], - $requirement['package'], - ]); - } - WCF::getDB()->commitTransaction(); - } - if (!empty($excludedPackagesParameters)) { $sql = "INSERT INTO wcf" . WCF_N . "_package_update_exclusion (packageUpdateVersionID, excludedPackage, excludedPackageVersion) diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 98f7c4ff57..5a46f6fad4 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -1049,6 +1049,7 @@ CREATE TABLE wcf1_package_update_fromversion ( UNIQUE KEY packageUpdateVersionID (packageUpdateVersionID, fromversion) ); +-- @deprecated DROP TABLE IF EXISTS wcf1_package_update_optional; CREATE TABLE wcf1_package_update_optional ( packageUpdateVersionID INT(10) NOT NULL DEFAULT 0,