From 8e80b77bb6149e600fd620184de3d1aede9988a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 19 May 2015 23:33:07 +0200 Subject: [PATCH] Remove obsolete update scripts (2.0 -> 2.1) --- com.woltlab.wcf/pre_update_check.tar | Bin 2560 -> 0 bytes com.woltlab.wcf/update_210.sql | 317 ------------------ com.woltlab.wcf/update_212.sql | 1 - com.woltlab.wcf/update_user1_210.sql | 1 - com.woltlab.wcf/update_user2_210.sql | 1 - com.woltlab.wcf/update_user3_210.sql | 1 - com.woltlab.wcf/update_user4_210.sql | 1 - com.woltlab.wcf/update_user5_210.sql | 1 - .../acp/pre_update_com.woltlab.wcf_2.1.php | 21 -- ...uild_attachments_com.woltlab.wcf_2.1.4.php | 91 ----- .../rebuild_comments_com.woltlab.wcf_2.1.php | 90 ----- .../files/acp/update_com.woltlab.wcf_2.1.php | 30 -- .../acp/update_mqc_com.woltlab.wcf_2.1.php | 46 --- 13 files changed, 601 deletions(-) delete mode 100644 com.woltlab.wcf/pre_update_check.tar delete mode 100644 com.woltlab.wcf/update_210.sql delete mode 100644 com.woltlab.wcf/update_212.sql delete mode 100644 com.woltlab.wcf/update_user1_210.sql delete mode 100644 com.woltlab.wcf/update_user2_210.sql delete mode 100644 com.woltlab.wcf/update_user3_210.sql delete mode 100644 com.woltlab.wcf/update_user4_210.sql delete mode 100644 com.woltlab.wcf/update_user5_210.sql delete mode 100644 wcfsetup/install/files/acp/pre_update_com.woltlab.wcf_2.1.php delete mode 100644 wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php delete mode 100644 wcfsetup/install/files/acp/rebuild_comments_com.woltlab.wcf_2.1.php delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_2.1.php delete mode 100644 wcfsetup/install/files/acp/update_mqc_com.woltlab.wcf_2.1.php diff --git a/com.woltlab.wcf/pre_update_check.tar b/com.woltlab.wcf/pre_update_check.tar deleted file mode 100644 index e37c9538083c1fd3ddaa11ed4ef70357b315abee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2560 zcmeHHO>5gg5Y<)s6+D=}sohcPeQDbIDzM(#A83@bLjaAK+ z#v;O5j6!F;jBb~}#p`*;^WprmXIWmoZb2PBvP!31nrAuASUE-s7bBE3yv?l{SP`V*NVuGv=e#JYGShRol&ruhmyhJ& zSynaydtI?^mqG|8@gAk3I@vT}$xx!mS&Vk=1tR+^!(3^}i^zHRQhN_I`lwpN`-|_l zU%p*CgaoedHvNUIUvnJzX_<>B$f?^+kSbFq6{%!9jZ->aW-}bWV&{BJIGmh7ZH%?$ zRa2*uPocyqY>8$ceaaBd9(Bd?Ol2smG69qmE=eN2QQ[a-zA-Z0-9_-]+)/sets/(?P[a-zA-Z0-9_-]+)', ''); -UPDATE wcf1_bbcode_media_provider SET regex = 'https?://soundcloud.com/(?P[a-zA-Z0-9_-]+)/(?!sets/)(?P[a-zA-Z0-9_-]+)' WHERE title = 'Soundcloud'; -UPDATE wcf1_bbcode_media_provider SET html = '' WHERE title = 'YouTube'; -UPDATE wcf1_bbcode_media_provider SET regex = 'https?://vimeo\\.com/(?P\\d+)', html = '' WHERE title = 'Vimeo'; - -/* - * ############################## - * ### TYPHOON UPDATE SERVERS ### - * ############################## - */ - -INSERT INTO wcf1_package_update_server (serverURL, status, isDisabled, errorMessage, lastUpdateTime, loginUsername, loginPassword) VALUES ('http://update.woltlab.com/typhoon/', 'online', 0, NULL, 0, '', ''); -INSERT INTO wcf1_package_update_server (serverURL, status, isDisabled, errorMessage, lastUpdateTime, loginUsername, loginPassword) VALUES ('http://store.woltlab.com/typhoon/', 'online', 0, NULL, 0, '', ''); - -/* - * ######################## - * ### MINOR UPDATES ###### - * ######################## - */ - -/* change default value to '1' */ -UPDATE wcf1_like SET time = 1 WHERE time = 0; diff --git a/com.woltlab.wcf/update_212.sql b/com.woltlab.wcf/update_212.sql deleted file mode 100644 index 7ea7d1c6b9..0000000000 --- a/com.woltlab.wcf/update_212.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE wcf1_bbcode_media_provider SET html = '' WHERE title = 'YouTube'; diff --git a/com.woltlab.wcf/update_user1_210.sql b/com.woltlab.wcf/update_user1_210.sql deleted file mode 100644 index decb8f7b2c..0000000000 --- a/com.woltlab.wcf/update_user1_210.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE wcf1_user ADD banExpires INT(10) NOT NULL DEFAULT 0; diff --git a/com.woltlab.wcf/update_user2_210.sql b/com.woltlab.wcf/update_user2_210.sql deleted file mode 100644 index 41a9d3f1a7..0000000000 --- a/com.woltlab.wcf/update_user2_210.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE wcf1_user ADD disableAvatarExpires INT(10) NOT NULL DEFAULT 0; diff --git a/com.woltlab.wcf/update_user3_210.sql b/com.woltlab.wcf/update_user3_210.sql deleted file mode 100644 index 1407ea3a45..0000000000 --- a/com.woltlab.wcf/update_user3_210.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE wcf1_user ADD disableSignatureExpires INT(10) NOT NULL DEFAULT 0; diff --git a/com.woltlab.wcf/update_user4_210.sql b/com.woltlab.wcf/update_user4_210.sql deleted file mode 100644 index 310f32fd2c..0000000000 --- a/com.woltlab.wcf/update_user4_210.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE wcf1_user ADD socialNetworkPrivacySettings TEXT; diff --git a/com.woltlab.wcf/update_user5_210.sql b/com.woltlab.wcf/update_user5_210.sql deleted file mode 100644 index bde38817d1..0000000000 --- a/com.woltlab.wcf/update_user5_210.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE wcf1_user ADD gravatarFileExtension VARCHAR(3) NOT NULL DEFAULT ''; diff --git a/wcfsetup/install/files/acp/pre_update_com.woltlab.wcf_2.1.php b/wcfsetup/install/files/acp/pre_update_com.woltlab.wcf_2.1.php deleted file mode 100644 index 9acde0309b..0000000000 --- a/wcfsetup/install/files/acp/pre_update_com.woltlab.wcf_2.1.php +++ /dev/null @@ -1,21 +0,0 @@ - - * @package com.woltlab.wcf - * @category Community Framework - */ - -if (Package::compareVersion(preg_replace('~ \(Maelstrom\)$~', '', WCF_VERSION), '2.0.10', '<')) { - if (WCF::getLanguage()->getFixedLanguageCode() == 'de') { - throw new SystemException("Die Aktualisierung erfordert WoltLab Community Framework (com.woltlab.wcf) in Version 2.0.10 oder hoeher"); - } - else { - throw new SystemException("Update requires at least WoltLab Community Framework (com.woltlab.wcf) in version 2.0.10 or higher"); - } -} diff --git a/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php b/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php deleted file mode 100644 index c64d355662..0000000000 --- a/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @package com.woltlab.wcf - * @category Community Framework - */ -$minimumAttachmentTime = 1425219870; // time of the release note - -$attachmentsPerRun = 100; -$rebuildData = WCF::getSession()->getVar('__wcfUpdateRebuildAttachments'); -if ($rebuildData === null) { - $sql = "SELECT COUNT(*) - FROM wcf".WCF_N."_attachment - WHERE isImage = ? - AND uploadTime >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - 1, - $minimumAttachmentTime - )); - $count = $statement->fetchColumn(); - - $rebuildData = array( - 'i' => 0, - 'max' => 0 - ); - - if ($count) { - $rebuildData['max'] = ceil($count / $attachmentsPerRun); - } -} - -if ($rebuildData['max']) { - // get attachment file data - $attachmentList = new AttachmentList(); - $attachmentList->getConditionBuilder()->add('isImage = ?', array(1)); - $attachmentList->getConditionBuilder()->add('uploadTime >= ?', array($minimumAttachmentTime)); - $attachmentList->sqlOffset = $rebuildData['i'] * $attachmentsPerRun; - $attachmentList->sqlLimit = $attachmentsPerRun; - $attachmentList->readObjects(); - - if (!count($attachmentList)) { - // all relevant attachments have been processed - WCF::getSession()->unregister('__wcfUpdateRebuildAttachments'); - } - else { - $attachmentUpdates = array(); - foreach ($attachmentList as $attachment) { - if (!file_exists($attachment->getLocation())) { - // missing files should not cause the update to fail - continue; - } - - $filesize = filesize($attachment->getLocation()); - if ($filesize != $attachment->filesize) { - $attachmentUpdates[$attachment->attachmentID] = $filesize; - } - } - - if (!empty($attachmentUpdates)) { - $sql = "UPDATE wcf".WCF_N."_attachment - SET filesize = ? - WHERE attachmentID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - - WCF::getDB()->beginTransaction(); - foreach ($attachmentUpdates as $attachmentID => $filesize) { - $statement->execute(array( - $filesize, - $attachmentID - )); - } - WCF::getDB()->commitTransaction(); - } - - // update rebuiled data - $rebuildData['i']++; - WCF::getSession()->register('__wcfUpdateRebuildAttachments', $rebuildData); - - throw new SplitNodeException(); - } -} diff --git a/wcfsetup/install/files/acp/rebuild_comments_com.woltlab.wcf_2.1.php b/wcfsetup/install/files/acp/rebuild_comments_com.woltlab.wcf_2.1.php deleted file mode 100644 index b764032cea..0000000000 --- a/wcfsetup/install/files/acp/rebuild_comments_com.woltlab.wcf_2.1.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @package com.woltlab.wcf - * @category Community Framework - */ -$commentsPerRun = 100; -$rebuildData = WCF::getSession()->getVar('__wcfUpdateRebuildComments'); -if ($rebuildData === null) { - $sql = "SELECT COUNT(*) AS count - FROM wcf".WCF_N."_comment - WHERE responses > ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array(3)); - $row = $statement->fetchSingleRow(); - - $rebuildData = array( - 'i' => 0, - 'max' => 0 - ); - - if ($row['count']) { - $rebuildData['max'] = ceil($row['count'] / $commentsPerRun); - } -} - -if ($rebuildData['max']) { - $offset = $rebuildData['i'] * $commentsPerRun; - - // get comments - $sql = "SELECT commentID - FROM wcf".WCF_N."_comment - WHERE responses > ? - ORDER BY commentID"; - $statement = WCF::getDB()->prepareStatement($sql, $commentsPerRun, $offset); - $statement->execute(array(3)); - - $commentIDs = array(); - while ($row = $statement->fetchArray()) { - $commentIDs[] = $row['commentID']; - } - - if (empty($commentIDs)) { - WCF::getSession()->unregister('__wcfUpdateRebuildComments'); - } - else { - // get responses per comment - $sql = "SELECT responseID - FROM wcf".WCF_N."_comment_response - WHERE commentID = ? - ORDER BY time ASC, responseID ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 5); - - $commentData = array(); - for ($i = 0, $length = count($commentIDs); $i < $length; $i++) { - $commentID = $commentIDs[$i]; - $commentData[$commentID] = array(); - - $statement->execute(array($commentID)); - while ($row = $statement->fetchArray()) { - $commentData[$commentID][] = $row['responseID']; - } - } - - // set responseIDs per comment - $sql = "UPDATE wcf".WCF_N."_comment - SET responseIDs = ? - WHERE commentID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - WCF::getDB()->beginTransaction(); - foreach ($commentData as $commentID => $responseIDs) { - $statement->execute(array( - serialize($responseIDs), - $commentID - )); - } - WCF::getDB()->commitTransaction(); - - $rebuildData['i']++; - WCF::getSession()->register('__wcfUpdateRebuildComments', $rebuildData); - - // call this script again - throw new SplitNodeException(); - } -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.1.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.1.php deleted file mode 100644 index 9bf180f2e4..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_2.1.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf - * @category Community Framework - */ - -$options = array( - 'cache_source_type' => (CACHE_SOURCE_TYPE == 'no' ? 'disk' : CACHE_SOURCE_TYPE), - 'last_update_time' => TIME_NOW, - 'url_legacy_mode' => 1, - 'url_to_lowercase' => 0, - 'user_cleanup_notification_lifetime' => (USER_CLEANUP_NOTIFICATION_LIFETIME == 60 ? 14 : USER_CLEANUP_NOTIFICATION_LIFETIME), - // the line below equals \wcf\util\StringUtil::getUUID(), but since we have to do it in one step, the "old" class exists in memory - 'wcf_uuid' => sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)) -); - -// clear recaptcha keys if public key and private key match WoltLab's OEM key -if (RECAPTCHA_PUBLICKEY === '6LfOlMYSAAAAADvo3s4puBAYDqI-6YK2ybe7BJE5' && RECAPTCHA_PRIVATEKEY === '6LfOlMYSAAAAAKR3m_EFxmDv1xS8PCfeaSZ2LdG9') { - $options['recaptcha_publickey'] = ''; - $options['recaptcha_privatekey'] = ''; -} - -OptionEditor::import($options); - -OptionEditor::resetCache(); diff --git a/wcfsetup/install/files/acp/update_mqc_com.woltlab.wcf_2.1.php b/wcfsetup/install/files/acp/update_mqc_com.woltlab.wcf_2.1.php deleted file mode 100644 index 2a54e5ac8c..0000000000 --- a/wcfsetup/install/files/acp/update_mqc_com.woltlab.wcf_2.1.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @package com.woltlab.wcf - * @category Community Framework - */ - -$sql = "SELECT objectTypeID - FROM wcf".WCF_N."_object_type - WHERE objectType = ? - AND definitionID = ( - SELECT definitionID - FROM wcf".WCF_N."_object_type_definition - WHERE definitionName = ? - )"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(array( - 'com.woltlab.wcf.moderation.queue', - 'com.woltlab.wcf.comment.commentableContent' -)); -$row = $statement->fetchArray(); - -// create comments for non-empty 'comment' fields -$sql = "INSERT INTO wcf".WCF_N."_comment - (objectTypeID, objectID, time, userID, username, message) - SELECT ".$row['objectTypeID'].", queueID, ".TIME_NOW.", NULL, 'Unknown', comment - FROM wcf".WCF_N."_moderation_queue - WHERE comment <> ''"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(); - -// set comment counter -$sql = "UPDATE wcf".WCF_N."_moderation_queue - SET comments = 1 - WHERE comment <> ''"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(); - -// drop comment column -WCF::getDB()->getEditor()->dropColumn('wcf'.WCF_N.'_moderation_queue', 'comment'); -- 2.20.1