Skip to content

[TASK] Upgrade league/flysystem from v1 to v3#5

Open
CybotTM wants to merge 1 commit intomainfrom
feature/flysystem-3
Open

[TASK] Upgrade league/flysystem from v1 to v3#5
CybotTM wants to merge 1 commit intomainfrom
feature/flysystem-3

Conversation

@CybotTM
Copy link
Owner

@CybotTM CybotTM commented Feb 22, 2026

Summary

  • Upgrade league/flysystem from abandoned v1 to v3
  • Migrate code to v3 API (LocalFilesystemAdapter, writeStream, FilesystemException)
  • Upstream phpdocumentor/guides 1.9.5 already supports flysystem v3

Changes

  • composer.json / composer.lock - constraint ^1.1.10 -> ^3.29, pulls in league/flysystem-local
  • CopyResources.php - Adapter\Local -> Local\LocalFilesystemAdapter, remove v1 false-check on readStream
  • TwigExtension.php - League\Flysystem\Exception -> League\Flysystem\FilesystemException
  • IncludeDirective.php - remove @throws \League\Flysystem\FileNotFoundException docblocks
  • SiteSetSettingsDirective.php - remove @throws \League\Flysystem\FileNotFoundException docblock
  • site-set-failure test expectations - v3 error message changed from "Path is outside of the defined root" to "Path traversal detected"

Test plan

  • PHPStan passes (0 errors)
  • Unit tests pass (83/83)
  • Integration tests pass (112/112)
  • Documentation rendering works (CI)

Copilot AI review requested due to automatic review settings February 22, 2026 11:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the project from the abandoned league/flysystem v1 to v3, aligning the docs theme + guides integration with the newer Flysystem API and updating integration test fixtures to match new exception messages.

Changes:

  • Bump Flysystem to v3 (and related dependency updates via composer.lock).
  • Migrate theme code to Flysystem v3 classes/exceptions (LocalFilesystemAdapter, FilesystemException).
  • Update integration test expected logs for Flysystem v3 path traversal error wording.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
composer.json Updates league/flysystem constraint to v3.
composer.lock Locks Flysystem v3 and related dependency updates (incl. league/flysystem-local).
packages/typo3-docs-theme/src/EventListeners/CopyResources.php Switches local adapter class; updates stream read logic for v3 behavior.
packages/typo3-docs-theme/src/Twig/TwigExtension.php Updates Flysystem exception type used in catch clause.
packages/typo3-docs-theme/src/Directives/IncludeDirective.php Removes obsolete Flysystem v1 @throws FileNotFoundException docblocks.
packages/typo3-docs-theme/src/Directives/SiteSetSettingsDirective.php Removes obsolete Flysystem v1 @throws FileNotFoundException docblock.
tests/Integration/tests/site-set-failure/expected/logs/error.log Adjusts expected error message to “Path traversal detected”.
tests/Integration/tests/site-set-failure/expected/logs/warning.log Adjusts expected warning message to “Path traversal detected”.
.github/workflows/main.yaml Adds a PHP version to the CI test matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CybotTM CybotTM force-pushed the feature/flysystem-3 branch from 8c46e6f to 05a32ed Compare March 1, 2026 12:52
Upgrade league/flysystem from v1 (1.x) to v3 (3.x):

- Replace league/flysystem ^1.1.10 with ^3.29
- Add league/flysystem-local ^3.0 dependency
- Replace Flysystem v1 API (put/putStream/has/read/readStream)
  with v3 equivalents (write/writeStream/fileExists/read/readStream)
- Update CopyResources to use FilesystemException with try/catch/finally
  for proper error handling and stream cleanup
- Update composer.lock (flysystem 3.32.0, flysystem-local 3.31.0,
  flyfinder 2.0.0)

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM CybotTM force-pushed the feature/flysystem-3 branch from 05a32ed to b54885e Compare March 1, 2026 12:54
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