Added a nice table for displaying currently available servers

This commit is contained in:
2022-09-24 17:33:59 -04:00
parent 25b68c4bc6
commit b41b246483
3 changed files with 54 additions and 4 deletions

View File

@ -54,6 +54,15 @@ $app->post('/create', function (Request $request, Response $response, $args) {
fclose($scriptFile);
chmod($scriptFilePath, 0755);
// save the current version to a text file - this will hopefully be temporary solution
$versionFilePath = join('/', array($serverDir, 'current_version.txt'));
$versionFile = fopen($versionFilePath, 'w');
$versionContent = $params['serverVersion'];
fwrite($versionFile, $versionContent);
fclose($versionFile);
chmod($versionFilePath, 0644);
// redirect the user back to the home page
return $response
->withHeader('Location', '/')
->withStatus(302);