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

Offen Anfängerfreundlich
#739 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
php
Bereich
backend, cli

Rechercherichtung

Lies zuerst ResourceCacheClearCommand::removeFilesFromDirectory(), die in der Issue genannte Methode, und prüfe, wie ihre Verzeichnisauflistung Dateien mit vorangestelltem Punkt behandelt. Reproduziere das Problem mit cache/test/.hidden und führe php qt cache:clear --all aus; fertig ist es, wenn der Befehl versteckte Dateien entfernt und mit „Resource cache cleared successfully.“ endet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
PHP
Sterne
44
Forks
22
Ø Merge
2 Std. 49 Min.
Gemergte PRs (30 T.)
61

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus quantum-php/framework

Alle Issues in quantum-php/framework

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.