Open
Description
Hello
Small suggestion : next to the Load button, add a "clear folder" button so the user can empty the trace folder.
In a very quick (and probably dirty) addition, I suggest to add something like this at the top of your file
$dir = ini_get('xdebug.trace_output_dir');
if (!$dir) $dir = '/tmp/';
if (isset($_GET['task'])) {
if ($_GET['task']==='empty')
{
$files = glob("$dir/*.xt");
$return='';
if (count($files)>0) {
foreach ($files as $file)
{
$return.=$file.'|';
unlink($file);
}
}
echo $return;
die();
} else {
$btnEmpty="<button id='emptyfolder'>Empty trace folder</button>".
"<script>\n".
" $('#emptyfolder').click(function (e) {\n".
" e.preventDefault();\n".
" $.ajax({\n".
" url: 'index.php?task=empty'\n".
" }).done(function() {\n".
" alert('Files in $dir have been removed');\n".
" });\n".
" });\n".
"</script>\n";
}
This will erase every .xt files (when ?task=empty is specified on the querystring).
Otherwise will initialize a $btnEmpty button.
In your html, next to the load button, just echo $btnEmpty.
Have a nice day.
Metadata
Metadata
Assignees
Labels
No labels