Open
Conversation
blued-gear
reviewed
Feb 24, 2026
| ``` | ||
|
|
||
| Options: | ||
| - `--ignored-paths=IGNORED-PATHS`: A comma seperated list of paths to be ignored in this process. If the path starts with one of the supplied string it will be skipped. e.g. "/cache" [default: ""] |
Collaborator
There was a problem hiding this comment.
Suggested change
| - `--ignored-paths=IGNORED-PATHS`: A comma seperated list of paths to be ignored in this process. If the path starts with one of the supplied string it will be skipped. e.g. "/cache" [default: ""] | |
| - `--ignored-paths=IGNORED-PATHS`: A comma seperated list of paths to be ignored in this process. If the path starts with one of the supplied strings it will be skipped. e.g. "/cache" [default: ""] |
src/Service/ImageManager.php
Outdated
| if ($deleteEmptyDirectories) { | ||
| $contents = $this->publicUploadsFilesystem->listContents($path); | ||
| $length = 0; | ||
| foreach ($contents as $content) { |
Collaborator
There was a problem hiding this comment.
this loop can be canceled after the first item or replaced with whatever "check for empty" functions the type of $contents supports
src/Service/ImageManager.php
Outdated
| foreach ($contents as $content) { | ||
| ++$length; | ||
| } | ||
| if (0 === $length) { |
Collaborator
There was a problem hiding this comment.
will this work for nested empty directories?
Member
Author
There was a problem hiding this comment.
No it will probably not. Also for s3 servers it would be a lot faster if I'd remove the default delimiter on the list operation, which would probably lead to no directories being listed anymore (I think)
src/Service/ImageManager.php
Outdated
| return [$path, end($parts)]; | ||
| } | ||
|
|
||
| private function shouldNodeBeIgnored(array $ignoredPaths, StorageAttributes $content): bool |
Collaborator
There was a problem hiding this comment.
this might be extracted to a util class and then covered by a unit test
blued-gear
reviewed
Feb 25, 2026
| [['/cache'], 'ca/fe/asdoihsd.png', false], | ||
| [['/cache'], 'cache/ca/fe/asdoihsd.png', true], | ||
| [['cache'], 'cache/ca/fe/asdoihsd.png', true], | ||
| [['/cache'], 'cache/ca/fe/asdoihsd.png', true], |
Collaborator
There was a problem hiding this comment.
this case is a duplicate; did you mean cache/?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.