Skip to content

Commit 0d1c6b9

Browse files
authored
Merge pull request #8740 from kenjis/fix-ClearDebugbar
fix: update `debugbar:clear` code because of file changes
2 parents 17ac8e6 + dd85fde commit 0d1c6b9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

system/Commands/Housekeeping/ClearDebugbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function run(array $params)
5757
{
5858
helper('filesystem');
5959

60-
if (! delete_files(WRITEPATH . 'debugbar')) {
60+
if (! delete_files(WRITEPATH . 'debugbar', false, true)) {
6161
// @codeCoverageIgnoreStart
6262
CLI::error('Error deleting the debugbar JSON files.');
6363
CLI::newLine();

tests/system/Commands/ClearDebugbarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testClearDebugbarWorks(): void
6161
$result = $this->getStreamFilterBuffer();
6262

6363
$this->assertFileDoesNotExist(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . "debugbar_{$this->time}.json");
64-
$this->assertFileExists(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . '.gitkeep');
64+
$this->assertFileExists(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . 'index.html');
6565
$this->assertStringContainsString('Debugbar cleared.', $result);
6666
}
6767
}

writable/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)