From: Alexander Ebert Date: Fri, 4 Nov 2011 20:38:06 +0000 (+0100) Subject: Packages are now continuously added to queue. X-Git-Tag: 2.0.0_Beta_1~1616^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=89142da9f2c8ff38530ce1eb3538adb4cefa65be;p=GitHub%2FWoltLab%2FWCF.git Packages are now continuously added to queue. The previous installation added packages without any kind of relation, thus rendering WCF unable to install them in a row (since there was no perceptible relation among them). --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 59e16ffbbf..43acf1480d 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -2,6 +2,7 @@ namespace wcf\system; use wcf\data\language\LanguageEditor; use wcf\data\language\SetupLanguage; +use wcf\data\package\installation\queue\PackageInstallationQueueEditor; use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\cache\CacheHandler; @@ -975,7 +976,6 @@ class WCFSetup extends WCF { $statement->execute(); $result = $statement->fetchArray(); $processNo = intval($result['processNo']) + 1; - $statementParameters = array(); // search existing wcf package $sql = "SELECT COUNT(*) AS count @@ -990,11 +990,11 @@ class WCFSetup extends WCF { } // register essential wcf package - $statementParameters[] = array( + $queue = PackageInstallationQueueEditor::create(array( 'package' => 'com.woltlab.wcf', 'packageName' => 'WoltLab Community Framework', 'archive' => TMP_DIR.'install/packages/'.$wcfPackageFile - ); + )); } // register all other delivered packages @@ -1011,28 +1011,12 @@ class WCFSetup extends WCF { continue; } - $statementParameters[] = array( + $queue = PackageInstallationQueueEditor::create(array( + 'parentQueueID' => $queue->queueID, 'package' => $packageName, 'packageName' => $archive->getPackageInfo('packageName'), 'archive' => TMP_DIR.'install/packages/'.$packageFile - ); - } - - if (!empty($statementParameters)) { - $sql = "INSERT INTO wcf".WCF_N."_package_installation_queue - (processNo, userID, package, packageName, archive) - VALUES (?, ?, ?, ?, ?)"; - $statement = self::getDB()->prepareStatement($sql); - - foreach ($statementParameters as $parameter) { - $statement->execute(array( - $processNo, - $admin->userID, - $parameter['package'], - $parameter['packageName'], - $parameter['archive'] - )); - } + )); } // login as admin