Skip to content

Commit 003a69c

Browse files
committed
Fix config preserve during composer update
1 parent 2adeb2a commit 003a69c

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,16 @@ jobs:
116116
cd test-composer/vendor/roundcube/roundcubemail
117117
ls -lah plugins/acl/config.*
118118
if [ ! -f plugins/acl/config.inc.php ]; then echo 'Config file was not created' && exit 1; fi
119+
120+
- name: Test update - install plugin
121+
run: |
122+
cd test-composer
123+
echo '// xxx no config update xxx' >> vendor/roundcube/roundcubemail/plugins/carddav/config.inc.php
124+
composer update -v --prefer-dist --no-interaction --no-progress roundcube/carddav --prefer-lowest
125+
126+
- name: Test update - verify install
127+
run: |
128+
cd test-composer
129+
ls -lah vendor/roundcube/roundcubemail/plugins/carddav/config.*
130+
if [ ! -f vendor/roundcube/roundcubemail/plugins/carddav/config.inc.php ]; then echo 'Config file was deleted' && exit 1; fi
131+
if ! grep -Fq 'xxx no config update xxx' vendor/roundcube/roundcubemail/plugins/carddav/config.inc.php; then echo 'Config file was replaced' && exit 1; fi

src/ExtensionInstaller.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,19 @@ public function getInstallPath(PackageInterface $package)
6363

6464
private function initializeRoundcubemailEnvironment(): void
6565
{
66-
// initialize Roundcube environment
6766
if (!defined('INSTALL_PATH')) {
6867
define('INSTALL_PATH', $this->getRoundcubemailInstallPath() . '/');
6968
}
7069
require_once INSTALL_PATH . 'program/include/iniset.php';
7170
}
7271

72+
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
73+
{
74+
$this->setRoundcubemailInstallPath($repo);
75+
76+
return parent::isInstalled($repo, $package);
77+
}
78+
7379
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
7480
{
7581
$this->setRoundcubemailInstallPath($repo);

0 commit comments

Comments
 (0)