php qt cache:clear --all fails on a folder that holds only hidden files

Aperta Adatta ai principianti
#739 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend, cli

Direzione di ricerca

Inizia leggendo ResourceCacheClearCommand::removeFilesFromDirectory(), il metodo menzionato nell’issue, e verifica come la sua enumerazione della directory gestisce i file il cui nome inizia con un punto. Riproduci il problema con cache/test/.hidden ed esegui php qt cache:clear --all; il lavoro è completato quando il comando rimuove i file nascosti e termina con “Resource cache cleared successfully.”

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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

  1. In a project, create cache/test/.hidden.
  2. Run php qt cache:clear --all.
  3. 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.

Lingua principale
PHP
Stelle
44
Fork
22
Merge medio
2h 49m
PR unite (30g)
61

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quantum-php/framework

Tutte le issue di quantum-php/framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.