From 0d1abf0e35bc29fcdbab92eebd17435363a14c37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 8 Jun 2022 12:17:01 +0200 Subject: [PATCH] Remove PackageUninstallationDispatcher::addQueueEntries() This method exists since the very first commit in this repository and is unused. Its purpose is not clear, but there is no reason for anything calling this method, if WCF itself doesn't. --- .../PackageUninstallationDispatcher.class.php | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php index 8ed717483c..4a1c0d92fd 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php @@ -4,7 +4,6 @@ namespace wcf\system\package; use wcf\data\option\OptionEditor; use wcf\data\package\installation\queue\PackageInstallationQueue; -use wcf\data\package\Package; use wcf\data\package\PackageEditor; use wcf\system\application\ApplicationHandler; use wcf\system\cache\builder\PackageCacheBuilder; @@ -173,48 +172,4 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher { new Uninstaller($targetDir, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories); } - - /** - * Adds an uninstall entry to the package installation queue. - * - * @param Package $package - * @param array $packages - */ - public static function addQueueEntries(Package $package, $packages = []) - { - // get new process no - $processNo = PackageInstallationQueue::getNewProcessNo(); - - // add dependent packages to queue - $statementParameters = []; - foreach ($packages as $dependentPackage) { - $statementParameters[] = [ - 'packageName' => $dependentPackage['packageName'], - 'packageID' => $dependentPackage['packageID'], - ]; - } - - // add uninstalling package to queue - $statementParameters[] = [ - 'packageName' => $package->getName(), - 'packageID' => $package->packageID, - ]; - - // insert queue entry (entries) - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_queue - (processNo, userID, package, packageID, action) - VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); - foreach ($statementParameters as $parameter) { - $statement->execute([ - $processNo, - WCF::getUser()->userID, - $parameter['packageName'], - $parameter['packageID'], - 'uninstall', - ]); - } - - self::openQueue(0, $processNo); - } } -- 2.20.1