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

未关闭 适合新手
#739 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php
领域
backend, cli

调研方向

首先阅读 issue 中提到的方法 ResourceCacheClearCommand::removeFilesFromDirectory(),并检查它列出目录内容时如何处理名称以点开头的文件。使用 cache/test/.hidden 复现问题,并运行 php qt cache:clear --all;当命令删除隐藏文件并以“Resource cache cleared successfully.”结束时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
PHP
星标
44
派生
22
平均合并
2 小时 49 分钟
30 天内合并 PR
61

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quantum-php/framework 的其他 Issue

查看 quantum-php/framework 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。