1

According to Pull Request #10825 for Craft 4, you can override the filesystem and path where the debugger files are stored for the Debug Toolbar. In the absence of using a separate filesystem, I'd like to be able to store these somewhere inside of the @runtime/temp folder since there is a clear-caches/temp-files command to clear this directory but not one specifically for the @runtime/debug folder.

So far, I've added a config/debug.php file that contains the following:

return [
    'dataPath' => '@runtime/temp/debug',
];

But the only effect this seems to have is 1) when it's set to @runtime/debug the files are created successfully in their normal location, or 2) for any other value the files aren't created whatsoever.

I looked into adding an action to the ClearCaches Utility specifically for clearing the debug folder, but after coming across the above pull request I wasn't sure how to implement it in such a way that would account for custom filesystems, so I thought just moving it to within another folder that's cleared when running a clear-caches command would be easier.

1 Answer 1

1

Turns out that what I had was actually creating the files but in a @runtime/temp/debug folder inside the web root. Parsing that string with App::parseEnv() did the trick, and the debugging files are now created successfully inside /storage/runtime/temp/debug and cleared with the clear-caches/temp-files console command:

use craft\helpers\App;

return [
    'dataPath' => App::parseEnv('@runtime/temp/debug')
];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.