php qt cache:clear --all fails on a folder that holds only hidden files
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start by reading ResourceCacheClearCommand::removeFilesFromDirectory(), the method named in the issue, and check how its directory listing handles dot-prefixed files. Reproduce with cache/test/.hidden and run php qt cache:clear --all; done means the command removes hidden files and finishes with “Resource cache cleared successfully.”
Written by the indexing model from the issue text.
Description
Summary
php qt cache:clear --all stops with rmdir(...): Directory not empty when a folder under the cache directory contains a file whose name starts with a dot, for example cache/composer/.htaccess.
Cause
ResourceCacheClearCommand::removeFilesFromDirectory() lists the entries with glob($dir . DS . '*'). The pattern does not match names that start with a dot, so the command never removes those files. It then counts the folder as empty and calls removeDirectory(), which fails.
Expected
cache:clear --all empties the folders it clears, hidden files included, and finishes with "Resource cache cleared successfully."
Steps to reproduce
- In a project, create
cache/test/.hidden. - Run
php qt cache:clear --all. - The command fails with
rmdir(.../cache/test): Directory not empty.
Note
--all empties the whole cache directory, not only the resource cache, so it also removes cache/data, the default location of the file cache adapter. Whether --all should be limited to the resource cache (views, asserts) is a separate question and not part of this ticket.
- Dominant language
- PHP
- Stars
- 44
- Forks
- 22
- Avg merge
- 2h 49m
- Merged PRs (30d)
- 61
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quantum-php/framework
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quantum-php/framework#737 ·
Maintainers usually reply within 1 day
-
tech debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
quantum-php/framework#696 ·
Maintainers usually reply within 1 day
-
routing testing
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
quantum-php/framework#547 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
quantum-php/framework#741 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 40/100
quantum-php/framework#740 ·
Maintainers usually reply within 1 day
All issues in quantum-php/framework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#7881 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
magicsunday/webtrees-docker#285 ·
Maintainers usually reply within 1 day
-
area/tests type/bug when/soon
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbookPossibly taken @mayankmajeji claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
WordPress/hosting-handbook#521 ·