-
Notifications
You must be signed in to change notification settings - Fork 13
add TYPO3 v13 compatibility #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,8 +15,29 @@ | |
| use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
| use WebVision\WvFileCleanup\Domain\Repository\FileRepository; | ||
|
|
||
| /** | ||
| The symfony commands wv_file_cleanup:cleanup and wv_file_cleanup:emptyrecycler are available. | ||
|
|
||
| Example of using the command controllers from CLI context: | ||
| .vendor/bin/typo3 wv_file_cleanup:cleanup --help | ||
| .vendor/bin/typo3 wv_file_cleanup:cleanup 1:/ -r --verbose | ||
| .vendor/bin/typo3 wv_file_cleanup:cleanup 1:/Redaktion/Bilder/Aktuelles/2016/ -r --verbose --dry-run | ||
| .vendor/bin/typo3 wv_file_cleanup:emptyrecycler 1:/ -a 1month --verbose | ||
| To only match *.pdf files you can set the fileNameDenyPattern to /^(?!.*\b.pdf\b)/ | ||
| .vendor/bin/typo3 wv_file_cleanup:cleanup 1:/ --verbose --dry-run --file-deny-pattern='/^(?!.*\b.pdf\b)/' | ||
|
|
||
| It is recommended to use the commands in a CLI context, but they can also be setup in the scheduler as scheduler tasks. | ||
|
|
||
| Options | ||
| You can configure an fileNameDenyPattern that holds a regular expression that is used to check the filename against. If the pattern matches the file is excluded from the cleanup and also not visible in het BE module. | ||
| Default value is /index.html/i so all index.html files are excluded and can be adjusted in the extension configuration (see extension manager). | ||
| The value can also be overwritten in the command controller (and scheduler task). | ||
| */ | ||
|
|
||
| /** | ||
| * Class CleanupCommand | ||
| * | ||
| * @package WebVision\WvFileCleanup\Command | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use the And defining the "sobfolder" as own "package" does not make sense anyway. Going to revert this when updating the pull-request. |
||
| */ | ||
| class CleanupCommand extends Command | ||
| { | ||
|
|
@@ -25,8 +46,9 @@ class CleanupCommand extends Command | |
| */ | ||
| protected FileRepository $fileRepository; | ||
|
|
||
| public function injectFileRepository(FileRepository $fileRepository): void | ||
| public function __construct(FileRepository $fileRepository) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We prefer to use Can you explain why you consideredto switch to constructor injection I'm going to revert this when streamlining/updateing the pull-request. |
||
| { | ||
| parent::__construct(); | ||
| $this->fileRepository = $fileRepository; | ||
| } | ||
|
|
||
|
|
@@ -76,6 +98,10 @@ protected function configure(): void | |
| } | ||
|
|
||
| /** | ||
| * @param InputInterface $input | ||
| * @param OutputInterface $output | ||
| * | ||
| * @return int | ||
| * @throws InsufficientFolderAccessPermissionsException | ||
| * @throws ResourceDoesNotExistException | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,20 +21,20 @@ class EmptyRecyclerCommand extends Command | |
| /** | ||
| * @var FileRepository | ||
| */ | ||
| protected $fileRepository; | ||
| protected FileRepository $fileRepository; | ||
|
|
||
| /** | ||
| * @var ResourceFactory | ||
| */ | ||
| protected $resourceFactory; | ||
| protected ResourceFactory $resourceFactory; | ||
|
|
||
| public function injectFileRepository(FileRepository $fileRepository): void | ||
| public function __construct( | ||
| FileRepository $fileRepository, | ||
| ResourceFactory $resourceFactory | ||
| ) | ||
| { | ||
| parent::__construct(); | ||
| $this->fileRepository = $fileRepository; | ||
| } | ||
|
|
||
| public function injectResourceFactory(ResourceFactory $resourceFactory): void | ||
| { | ||
| $this->resourceFactory = $resourceFactory; | ||
| } | ||
|
|
||
|
|
@@ -78,6 +78,10 @@ protected function configure(): void | |
| } | ||
|
|
||
| /** | ||
| * @param InputInterface $input | ||
| * @param OutputInterface $output | ||
| * | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like core we omit phpdocblock if native types are used until additional information are added, which is not the case here. Further we don't align Going to revert this when updating the pull-request. |
||
| * @return int | ||
| * @throws InsufficientFolderAccessPermissionsException | ||
| */ | ||
| protected function execute(InputInterface $input, OutputInterface $output): int | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this as class PHP docblock does not make sense at all. I'd say
the command helptext needs to be adjusted to add explain this in more
detail.
Additionally, starting (adding) documentation (
Documentation/) inrenderable state should be done and explain it in the documentation
along with adding it to the
README.mdfile.Going to have look on that when updatein the pull-request for the
required changes and rebasing it after extension repository is in
the correct state to merge this (branching out the 2.x branch).