Commit b0d7376
committed
[BUG] filesystem: skip symbolic links instead of aborting
`FlySystemAdapter::createForPath()` instantiates the Local/Flysystem
adapter with the default link-handling mode, which is
`DISALLOW_LINKS` in both `league/flysystem` v1 (`Adapter\Local`) and
v3 (`Local\LocalFilesystemAdapter`). When the adapter's
`listContents()` encounters any symbolic link during directory
traversal it throws — v1: `League\Flysystem\NotSupportedException`,
v3: `League\Flysystem\SymbolicLinkEncountered` — aborting the whole
render.
Concrete consumer impact
------------------------
`phpDocumentor\Guides\Handlers\ParseDirectoryHandler` calls
`FlySystemAdapter::listContents()` to find the entrypoint of an
input directory. A single symlink anywhere in the input tree kills
the run, even for symlinks that point to files the parser would
ignore anyway (e.g. `CLAUDE.md -> AGENTS.md` for AI tooling, vendored
references, build artefacts).
Downstream report in the TYPO3 render-guides wrapper:
TYPO3-Documentation/render-guides#1234
Fix
---
Pass `SKIP_LINKS` as the link-handling constructor argument to both
the v1 and v3 Local adapters. This preserves the current "do not
follow links" posture but turns an abort into a silent skip — aligning
with how most documentation builders treat filesystem entries they
can't or shouldn't parse.
- v1: `new Local($path, LOCK_EX, Local::SKIP_LINKS)` (positional, since
v1's constructor predates named args; `LOCK_EX` is the library's own
default for `$writeFlags`).
- v3: `new LocalFilesystemAdapter($path, linkHandling: SKIP_LINKS)`
(named arg, skipping the unchanged `$visibility` and `$writeFlags`).
Verification
------------
The project has `FlySystemAdapter::createForPath` as its one code
path for building filesystem instances from a local path, so this
covers every entry point. Downstream reproducer (now green once
shipped):
ln -s AGENTS.md Documentation/CLAUDE.md
docker run --rm -v "$PWD:/project" -w /project \
ghcr.io/typo3-documentation/render-guides:latest \
render --config=Documentation --output=out Documentation
Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>1 parent 5979f82 commit b0d7376
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
0 commit comments