Remove PackageUninstallationDispatcher::addQueueEntries()
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 8 Jun 2022 10:17:01 +0000 (12:17 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 8 Jun 2022 10:18:35 +0000 (12:18 +0200)
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.

wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php

index 8ed717483cb7a65874ca519055e556f7bf6c913e..4a1c0d92fd5d2eeac90a4a758152534d2ed0f6fb 100644 (file)
@@ -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);
-    }
 }