Skip to content

Commit

Permalink
Merge pull request #8740 from kenjis/fix-ClearDebugbar
Browse files Browse the repository at this point in the history
fix: update `debugbar:clear` code because of file changes
  • Loading branch information
kenjis committed Apr 9, 2024
2 parents 17ac8e6 + dd85fde commit 0d1c6b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/Commands/Housekeeping/ClearDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function run(array $params)
{
helper('filesystem');

if (! delete_files(WRITEPATH . 'debugbar')) {
if (! delete_files(WRITEPATH . 'debugbar', false, true)) {
// @codeCoverageIgnoreStart
CLI::error('Error deleting the debugbar JSON files.');
CLI::newLine();
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/ClearDebugbarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testClearDebugbarWorks(): void
$result = $this->getStreamFilterBuffer();

$this->assertFileDoesNotExist(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . "debugbar_{$this->time}.json");
$this->assertFileExists(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . '.gitkeep');
$this->assertFileExists(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . 'index.html');
$this->assertStringContainsString('Debugbar cleared.', $result);
}
}
11 changes: 11 additions & 0 deletions writable/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>

0 comments on commit 0d1c6b9

Please sign in to comment.