added ability to clear history

This commit is contained in:
trashbo4t
2019-04-13 12:46:03 -04:00
parent f12bcf4989
commit bcd558283d
3 changed files with 42 additions and 0 deletions

View File

@@ -14,6 +14,9 @@ class InternetSpeedTest extends Module
public function route()
{
switch ($this->request->action) {
case 'clearTests':
$this->clearTests();
break;
case 'clearLogFile':
$this->clearLogFile();
break;
@@ -73,6 +76,17 @@ class InternetSpeedTest extends Module
}
}
//
// clearTests
// this function will wipe all of the tests and test file inside the IST directory
//
private function clearTests()
{
exec("rm {$this->ALL_TESTS_FILE}");
exec("rm -rf {$this->SPEED_TEST_DIR}");
$this->makeSpeedTestsDir();
}
//
// runSpeedTest
// this function will execute a wget command and download 50 MB worth of data