diff --git a/src/ExtensionInstaller.php b/src/ExtensionInstaller.php index 12bdead..166ee98 100644 --- a/src/ExtensionInstaller.php +++ b/src/ExtensionInstaller.php @@ -70,7 +70,7 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa $postInstall = function () use ($package) { $config_file = $this->rcubeConfigFile(); $package_name = $this->getPackageName($package); - $package_dir = $this->getVendorDir() . \DIRECTORY_SEPARATOR . $package_name; + $package_dir = $this->getInstallPath($package); $extra = $package->getExtra(); if (is_writable($config_file) && \PHP_SAPI === 'cli' && $this->confirmInstall($package_name)) { @@ -143,8 +143,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini $fs = new Filesystem(); // backup persistent files e.g. config.inc.php - $package_name = $this->getPackageName($initial); - $package_dir = $this->getVendorDir() . \DIRECTORY_SEPARATOR . $package_name; + $package_dir = $this->getInstallPath($initial); $temp_dir = $package_dir . '-' . sprintf('%010d%010d', mt_rand(), mt_rand()); // make a backup of existing files (for restoring persistent files) @@ -152,7 +151,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini $postUpdate = function () use ($target, $extra, $fs, $temp_dir) { $package_name = $this->getPackageName($target); - $package_dir = $this->getVendorDir() . \DIRECTORY_SEPARATOR . $package_name; + $package_dir = $this->getInstallPath($target); // restore persistent files $persistent_files = !empty($extra['roundcube']['persistent-files']) ? $extra['roundcube']['persistent-files'] : ['config.inc.php']; @@ -217,7 +216,7 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $ $postUninstall = function () use ($package, $config) { // post-uninstall: deactivate package $package_name = $this->getPackageName($package); - $package_dir = $this->getVendorDir() . \DIRECTORY_SEPARATOR . $package_name; + $package_dir = $this->getInstallPath($package); $this->rcubeAlterConfig($package_name, false); @@ -400,7 +399,7 @@ private function rcubeRunScript($script, PackageInterface $package) { $package_name = $this->getPackageName($package); $package_type = $package->getType(); - $package_dir = $this->getVendorDir() . \DIRECTORY_SEPARATOR . $package_name; + $package_dir = $this->getInstallPath($package); // check for executable shell script if (($scriptfile = realpath($package_dir . \DIRECTORY_SEPARATOR . $script)) && is_executable($scriptfile)) { @@ -424,7 +423,7 @@ private function rcubeRunScript($script, PackageInterface $package) } /** - * normalize Roundcube version string. + * Normalize Roundcube version string. */ private static function versionNormalize(string $version): string {