From: Joshua Rüsweg Date: Thu, 2 Aug 2018 13:03:29 +0000 (+0200) Subject: Remove FQN X-Git-Tag: 5.2.0_Alpha_1~364^2~101^2~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d903bf750e1fa09c815543378afd75cf878d872f;p=GitHub%2FWoltLab%2FWCF.git Remove FQN See #2508 --- diff --git a/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php b/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php index 59e0114afb..5e5a95b665 100644 --- a/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php +++ b/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php @@ -1,5 +1,7 @@ beginTransaction(); + WCF::getDB()->beginTransaction(); // add reaction columns - $statement = \wcf\system\WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES (\'wcf.reactionType.title1\', 1, 1, \'like.svg\'), (\'wcf.reactionType.title2\', 1, 2, \'haha.svg\'), (\'wcf.reactionType.title3\', -1, 3, \'sad.svg\'), (\'wcf.reactionType.title4\', 0, 4, \'confused.svg\'), (\'wcf.reactionType.title5\', 1, 5, \'thanks.svg\')')); + $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES (\'wcf.reactionType.title1\', 1, 1, \'like.svg\'), (\'wcf.reactionType.title2\', 1, 2, \'haha.svg\'), (\'wcf.reactionType.title3\', -1, 3, \'sad.svg\'), (\'wcf.reactionType.title4\', 0, 4, \'confused.svg\'), (\'wcf.reactionType.title5\', 1, 5, \'thanks.svg\')')); $statement->execute(); // update current likes $sql = "UPDATE wcf1_like SET reactionTypeID = ? WHERE likeValue = ?"; - $statement = \wcf\system\WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', $sql)); + $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', $sql)); $statement->execute([ - \wcf\data\like\Like::LIKE, + Like::LIKE, 1 ]); $statement->execute([ - \wcf\data\like\Like::DISLIKE, + Like::DISLIKE, 3 ]); // delete outdated likes, which aren't likes nor dislikes (normally none should exist) $sql = "DELETE wcf1_like WHERE reactionTypeID = 0"; - $statement = \wcf\system\WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', $sql)); + $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', $sql)); // add foreign key - $statement = \wcf\system\WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'ALTER TABLE wcf1_like ADD FOREIGN KEY (reactionTypeID) REFERENCES wcf1_reaction_type (reactionTypeID) ON DELETE CASCADE')); + $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'ALTER TABLE wcf1_like ADD FOREIGN KEY (reactionTypeID) REFERENCES wcf1_reaction_type (reactionTypeID) ON DELETE CASCADE')); $statement->execute(); - \wcf\system\WCF::getDB()->commitTransaction(); + WCF::getDB()->commitTransaction(); } catch (Exception $e) { - \wcf\system\WCF::getDB()->rollBackTransaction(); + WCF::getDB()->rollBackTransaction(); throw $e; }