Skip to content

fix(linker): skip sandbox web/var dirs and dangling files - #29

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/skip-sandbox-web-var
Sep 9, 2026
Merged

ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/skip-sandbox-web-var

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Skip accidental web/ and var/ sandbox trees when linking Horde apps into web/$app
  • Skip unreadable files and dangling symlinks instead of aborting horde:reconfigure

Motivation

composer update / horde:reconfigure failed in proxy mode while linking Gollem:

file_get_contents(.../vendor/horde/gollem/web/js/horde/accesskeys.js): No such file or directory

Gollem's FRAMEWORK_6_0 branch contains leftover Composer sandbox directories (web/, var/) even though they are listed in .gitignore. Those trees include dangling JS symlinks whose relative targets only work at the deployment root.

ApplicationLinker empties web/gollem/ first, then dies on the dangling symlink, so the app has no index.php. Apache rewrites /gollem/ to Rampage, which has no Gollem routes, and the UI shows "No route matched".

Changes

  • Add web and var to the directory filter in both symlink and proxy modes
  • Check is_file() / is_readable() before file_get_contents() so dangling links do not become Composer ErrorExceptions
  • Add ApplicationLinkerTest covering a Gollem-like sandbox tree with a dangling web/js/horde/accesskeys.js symlink

Test plan

  • vendor/bin/phpunit -c vendor/horde/horde-installer-plugin/phpunit.xml.dist --bootstrap vendor/autoload.php vendor/horde/horde-installer-plugin/test/ApplicationLinkerTest.php
  • composer horde:reconfigure completes with Gollem (or another app) still containing a leftover web/ sandbox tree
  • web/gollem/index.php exists after reconfigure
  • Opening /gollem/ in the browser reaches the app (or login), not "No route matched"

ApplicationLinker in proxy mode recursively copies app packages into
web/$app. Accidental composer sandbox trees (web/, var/) committed in an
app package can contain dangling JS symlinks; file_get_contents() then
aborts horde:reconfigure and leaves web/$app empty (Rampage "No route").

Skip those directories in both symlink and proxy filters, and skip
unreadable files before reading them.
@ralflang
ralflang merged commit 6d9fc82 into FRAMEWORK_6_0 Sep 9, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants