Skip to content

Commit

Permalink
Fix config preserve during composer update
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 3, 2024
1 parent 2adeb2a commit 003a69c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,16 @@ jobs:
cd test-composer/vendor/roundcube/roundcubemail
ls -lah plugins/acl/config.*
if [ ! -f plugins/acl/config.inc.php ]; then echo 'Config file was not created' && exit 1; fi
- name: Test update - install plugin
run: |
cd test-composer
echo '// xxx no config update xxx' >> vendor/roundcube/roundcubemail/plugins/carddav/config.inc.php
composer update -v --prefer-dist --no-interaction --no-progress roundcube/carddav --prefer-lowest
- name: Test update - verify install
run: |
cd test-composer
ls -lah vendor/roundcube/roundcubemail/plugins/carddav/config.*
if [ ! -f vendor/roundcube/roundcubemail/plugins/carddav/config.inc.php ]; then echo 'Config file was deleted' && exit 1; fi
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
8 changes: 7 additions & 1 deletion src/ExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ public function getInstallPath(PackageInterface $package)

private function initializeRoundcubemailEnvironment(): void
{
// initialize Roundcube environment
if (!defined('INSTALL_PATH')) {
define('INSTALL_PATH', $this->getRoundcubemailInstallPath() . '/');
}
require_once INSTALL_PATH . 'program/include/iniset.php';
}

public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->setRoundcubemailInstallPath($repo);

return parent::isInstalled($repo, $package);
}

public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$this->setRoundcubemailInstallPath($repo);
Expand Down

0 comments on commit 003a69c

Please sign in to comment.