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

Đang mở Phù hợp với người mới
#739 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend, cli

Hướng nghiên cứu

Bắt đầu bằng cách đọc ResourceCacheClearCommand::removeFilesFromDirectory(), phương thức được nêu trong issue, và kiểm tra cách việc liệt kê thư mục xử lý các tệp có tên bắt đầu bằng dấu chấm. Tái hiện với cache/test/.hidden và chạy php qt cache:clear --all; hoàn tất khi lệnh xóa các tệp ẩn và kết thúc với “Resource cache cleared successfully.”

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
PHP
Star
44
Fork
22
Merge trung bình
2 giờ 49 phút
Pull request đã merge (30 ngày)
61

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quantum-php/framework

Tất cả issue của quantum-php/framework

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.