From aa7ed43d07b2cd10ab76d78ba6da268c77bf92c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 3 May 2024 11:20:12 +0200 Subject: [PATCH] Make sure the "roundcube/roundcubemail" install path never changes --- src/ExtensionInstaller.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ExtensionInstaller.php b/src/ExtensionInstaller.php index 618b3e5..3ea5a77 100644 --- a/src/ExtensionInstaller.php +++ b/src/ExtensionInstaller.php @@ -36,9 +36,15 @@ protected function setRoundcubemailInstallPath(InstalledRepositoryInterface $ins if ($roundcubemailPackage === $rootPackage) { // $this->getInstallPath($package) does not work for root package $this->initializeVendorDir(); - $this->roundcubemailInstallPath = dirname($this->vendorDir); + $installPath = dirname($this->vendorDir); } else { - $this->roundcubemailInstallPath = $this->getInstallPath($roundcubemailPackage); + $installPath = $this->getInstallPath($roundcubemailPackage); + } + + if ($this->roundcubemailInstallPath === null) { + $this->roundcubemailInstallPath = $installPath; + } elseif ($this->roundcubemailInstallPath !== $installPath) { + throw new \Exception('Install path of "roundcube/roundcubemail" package has unexpectedly changed'); } }