Skip to content

Add SymlinkProtectFilesystemAdapter#170

Open
BrianHenryIE wants to merge 159 commits into
masterfrom
add/SymlinkProtectFileSystem
Open

Add SymlinkProtectFilesystemAdapter#170
BrianHenryIE wants to merge 159 commits into
masterfrom
add/SymlinkProtectFileSystem

Conversation

@BrianHenryIE

@BrianHenryIE BrianHenryIE commented Apr 28, 2025

Copy link
Copy Markdown
Owner

Adds SymlinkProtectFilesystemAdapter which prevents write operations on files inside symlinks.

Closes #64
Progresses #151
Related #103

TODO:

  • Check for symlinks when reading files
  • After enumerating files, halt if there are symlinks in the project and target_directory = vendor or delete_vendor_files = true
  • Extract the adapter to its own repo/package (let's do this as a separate PR)
  • Improve log messages – teach about COMPOSER_MIRROR_PATH_REPOS as a solution
  • Report the existence of symlinks when using ReadOnlyFileSystem --dry-run (solved problem but no test written yet)

Requires:

@github-actions

github-actions Bot commented Apr 28, 2025

Copy link
Copy Markdown

strauss.phar.zip @ 8a8b37c \n composer require brianhenryie/strauss:"dev-master#8a8b37c9a8c6ba2875e46f8c9ff687219240b9c5" --dev

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

Project Code Coverage
project coverage report 42% @ 608b217

Code Coverage

Generated: Tue, Apr 21, 2026, 20:25:00 UTC.

Lines Functions and Methods Classes and Traits
Total 🟥🟥🟥🟥⬜⬜⬜⬜⬜⬜ 42.00% (1352 / 3219) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 31.96% (116 / 363) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 3.33% (1 / 30)
Composer/Extra/StraussConfig.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 68.42% (143 / 209) 🟥🟥🟥🟥⬜⬜⬜⬜⬜⬜ 46.77% (29 / 62) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Composer/ComposerPackage.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 68.12% (47 / 69) 🟥🟥🟥🟥🟥⬜⬜⬜⬜⬜ 50.00% (12 / 24) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Config/AutoloadConfigInterface.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Config/CleanupConfigInterface.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Config/FileEnumeratorConfig.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Config/FileSymbolScannerConfigInterface.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Console/Commands/AbstractRenamespacerCommand.php 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 34.48% (30 / 87) 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 20.00% (1 / 5) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Console/Commands/DependenciesCommand.php 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 26.52% (96 / 362) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 4.55% (1 / 22) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Console/Commands/IncludeAutoloaderCommand.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 13.04% (3 / 23) 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 25.00% (1 / 4) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Console/Commands/ReplaceCommand.php 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 22.81% (26 / 114) 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 11.11% (1 / 9) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Files/File.php 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 36.36% (8 / 22) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 30.00% (6 / 20) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Files/FileBase.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Files/FileWithDependency.php 🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜ 81.25% (13 / 16) 🟥🟥🟥🟥🟥⬜⬜⬜⬜⬜ 50.00% (3 / 6) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/Log/RelativeFilepathLogProcessor.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 12.50% (1 / 8) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 33.33% (1 / 3) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/DeletedFilesInMemoryFilesystemAdapter.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Helpers/FileSystem.php 🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜ 52.69% (88 / 167) 🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜ 56.25% (18 / 32) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/FlysystemBackCompatTrait.php 🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜ 86.36% (19 / 22) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 2) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/FlysystemBackCompatTraitInterface.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Helpers/InMemoryFilesystemAdapter.php 🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜ 55.56% (10 / 18) 🟥🟥🟥🟥🟥⬜⬜⬜⬜⬜ 50.00% (3 / 6) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/ModifiedFilesInMemoryFilesystemAdapter.php n/a (0 / 0) n/a (0 / 0) n/a (0 / 0)
Helpers/PathPrefixer.php 🟥🟥🟥🟥⬜⬜⬜⬜⬜⬜ 46.67% (7 / 15) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 5) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/ReadOnlyFileSystem.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 69.34% (95 / 137) 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 21.74% (5 / 23) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Helpers/SymlinkProtectFilesystemAdapter.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 10.26% (31 / 302) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 4.17% (1 / 24) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Autoload/ComposerAutoloadGeneratorFactory.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (4 / 4) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1)
Pipeline/Autoload/DumpAutoload.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 63.43% (85 / 134) 🟥🟥🟥🟥⬜⬜⬜⬜⬜⬜ 42.86% (3 / 7) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Cleanup/Cleanup.php ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 6.50% (8 / 123) 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 25.00% (2 / 8) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Cleanup/InstalledJson.php 🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜ 59.92% (145 / 242) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 36.36% (4 / 11) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Autoload.php ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 31) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 2) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/AutoloadedFilesEnumerator.php ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 99) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 3) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Copier.php 🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜ 58.97% (23 / 39) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 33.33% (1 / 3) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/DependenciesEnumerator.php ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 103) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 5) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/FileCopyScanner.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 16.36% (9 / 55) 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 16.67% (1 / 6) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/FileEnumerator.php ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 6.67% (4 / 60) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 4) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/FileSymbolScanner.php 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 29.09% (32 / 110) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 9) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Licenser.php 🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜ 54.92% (67 / 122) 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 16.67% (1 / 6) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/MarkSymbolsForRenaming.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 18.00% (18 / 100) 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 18.75% (3 / 16) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Pipeline/Prefixer.php 🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜ 82.27% (283 / 344) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 35.71% (5 / 14) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
Types/DiscoveredSymbols.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 69.51% (57 / 82) 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 61.90% (13 / 21) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)

@BrianHenryIE BrianHenryIE mentioned this pull request Apr 30, 2026
3 tasks
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.

Add and extract SymlinkFileSystem package Add warning about using composer packages installed with symlink

1 participant