Added missing script
authorAlexander Ebert <ebert@woltlab.com>
Sun, 19 May 2013 19:43:34 +0000 (21:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 19 May 2013 19:43:34 +0000 (21:43 +0200)
wcfsetup/install/files/acp/update_4.0.0_b1.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/acp/update_4.0.0_b1.php b/wcfsetup/install/files/acp/update_4.0.0_b1.php
new file mode 100644 (file)
index 0000000..a7b04f6
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+namespace wcf\acp;
+use wcf\data\package\Package;
+use wcf\data\package\PackageList;
+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
+ */
+$packageList = new PackageList();
+$packageList->getConditionBuilder()->add("isApplication = 1");
+$packageList->readObjects();
+
+$sql = "UPDATE wcf".WCF_N."_acp_template
+       SET     application = ?
+       WHERE   packageID = ?";
+$acpStatement = WCF::getDB()->prepareStatement($sql);
+
+$sql = "UPDATE wcf".WCF_N."_package_installation_file_log
+       SET     application = ?
+       WHERE   packageID = ?";
+$logStatement = WCF::getDB()->prepareStatement($sql);
+
+$sql = "UPDATE wcf".WCF_N."_template
+       SET     application = ?
+       WHERE   packageID = ?";
+$tplStatement = WCF::getDB()->prepareStatement($sql);
+
+foreach ($packageList as $package) {
+       $acpStatement->execute(array(
+               Package::getAbbreviation($package->package),
+               $package->packageID
+       ));
+       
+       $logStatement->execute(array(
+               Package::getAbbreviation($package->package),
+               $package->packageID
+       ));
+       
+       $tplStatement->execute(array(
+               Package::getAbbreviation($package->package),
+               $package->packageID
+       ));
+}