Added script-PIP to remove old language items 2.0.0_RC_1
authorAlexander Ebert <ebert@woltlab.com>
Fri, 8 Nov 2013 15:33:37 +0000 (16:33 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 8 Nov 2013 15:33:48 +0000 (16:33 +0100)
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/update_rc1.php [new file with mode: 0644]

index 0e6d8a88c01e8f3dc3d656daa71e2bb1d0b2926f..84c950bbb8d78d3ce106a71af19dd221a1a93042 100644 (file)
@@ -48,6 +48,7 @@
                <instruction type="file">files_update.tar</instruction>
                <instruction type="template">templates_update.tar</instruction>
                <instruction type="language">language/*.xml</instruction>
+               <instruction type="script">acp/update_rc1.php</instruction>
                
                <instruction type="option">option.xml</instruction>
                
diff --git a/wcfsetup/install/files/acp/update_rc1.php b/wcfsetup/install/files/acp/update_rc1.php
new file mode 100644 (file)
index 0000000..bb3f4a6
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\WCF;
+
+/**
+ * @author     Alexander Ebert
+ * @copyright  2001-2013 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @category   Community Framework
+ */
+
+// remove outdated language items
+$conditions = new PreparedStatementConditionBuilder();
+$conditions->add("languageItem IN (?)", array(array(
+       'wcf.date.month.jan',
+       'wcf.date.month.feb',
+       'wcf.date.month.mar',
+       'wcf.date.month.apr',
+       // may is intentionally left out because it conflicts with the full month name
+       'wcf.date.month.jun',
+       'wcf.date.month.jul',
+       'wcf.date.month.aug',
+       'wcf.date.month.sep',
+       'wcf.date.month.oct',
+       'wcf.date.month.nov',
+       'wcf.date.month.dec'
+)));
+$sql = "DELETE FROM    wcf".WCF_N."_language_item
+       ".$conditions;
+$statement = WCF::getDB()->prepareStatement($sql);
+$statement->execute($conditions->getParameters());