getLoop() * @param DownloaderInterface $downloader Downloader instance you can get from $composer->getDownloadManager()->getDownloader('zip') for example * @param string $path the installation path for the package * @param PackageInterface $package the package to install * @param PackageInterface|null $prevPackage the previous package if this is an update and not an initial installation */ public static function downloadAndInstallPackageSync( Loop $loop, DownloaderInterface $downloader, string $path, PackageInterface $package, ?PackageInterface $prevPackage = null, ): void { $type = $prevPackage ? 'update' : 'install'; try { self::await($loop, $downloader->download($package, $path, $prevPackage)); self::await($loop, $downloader->prepare($type, $package, $path, $prevPackage)); if ($type === 'update') { self::await($loop, $downloader->update($package, $prevPackage, $path)); } else { self::await($loop, $downloader->install($package, $path)); } } catch (\Exception $e) { self::await($loop, $downloader->cleanup($type, $package, $path, $prevPackage)); throw $e; } self::await($loop, $downloader->cleanup($type, $package, $path, $prevPackage)); } /** * Waits for a promise to resolve * * @param Loop $loop Loop instance which you can get from $composer->getLoop() */ public static function await(Loop $loop, ?PromiseInterface $promise = null): void { if ($promise) { $loop->wait([$promise]); } } } __halt_compiler();----SIGNATURE:----rsY2wZ/+OxVPtYEh3p3dE+y8NByUTq8R4WPH5KkqZUNhuTMPXYsuN7obH5bDFgKIfeK9O2BqCODExUt7WWejuUwCdlOBRArSbavAoLvLgVPgOBc36NCZG5gdIvPLsoBnkkvgPJzB5w6LYN7xX8OnEgDKiJKould1TWT5L1ZsMhnQfpntgFNmWvLI5MXAZtU+aEaWMA8i0HAy0M7m0F8vG5uY1ql08oKjsRrDGxDRxhgkaYWUc6NUtkGrvvMy8xCrj43PnP2GG+nIWVsH96o35o5eILtMbHtT3aFW15AvG+WoUZYrDcnrZpzCWWAi3Whc8kvBFm5yDWBxAEGvn+NRopTSWWh6e+eVOmlQsKo6dPsf4Qw62FK5vsEZv2cmahKOYLyetSFkUeFmc8a0QRqrqws9xoN9rvhDUF4YI/4mMIv0Q0oHnNTFIcuMuRIfLzkV4nMXtIL7BLYrNbK1OJ8lSZpj+72aQePnP5bRNVy/ZWaBipAs/AEof1qkY8RJ7EaRTVgMwDbNuKL2+MN1DLKCbXan4Adk6boZc69SCo9KOIAKXzD6k3ngDFJ6Szq1xXx4fU5Cq9Mg4zWTZ4m+J+6H3LaXJtxjUFQf52PnDPdwiygdsmOxZKFv4pvBnsX1IoC8pbn04wA8akUuGl1o5vqaOkgVDgnklOHeH1auOUp6X/w=----ATTACHMENT:----NDI0NDgxNTE1MTMwOTA2NCA2MzcxODcxMjIwMzE3NjQyIDUwMTc5NDE3ODgyMTg4