new database

This commit is contained in:
2021-04-19 09:15:15 +02:00
parent 24663071e6
commit 22a431da07
43 changed files with 423 additions and 302 deletions
+11 -11
View File
@@ -13,15 +13,15 @@ function ZipFileHandler(string $gameFileName, string $gameFileTmp): string
$headerType = mime_content_type($gameFileTmp);
$headerTypeMatch = array('application/zip');
if(in_array($headerType,$headerTypeMatch)){
$gameFileNewName = uniqid("", true). "." . $fileActualExtGame;
if(empty($gameFileName)){
if (in_array($headerType, $headerTypeMatch)) {
$gameFileNewName = uniqid("", true) . "." . $fileActualExtGame;
if (empty($gameFileName)) {
http_response_code(400);
exit();
}
rename($gameFileTmp,"../../Games/".$gameFileNewName);
rename($gameFileTmp, "../../Games/" . $gameFileNewName);
return $gameFileNewName;
}else{
} else {
http_response_code(400);
echo json_encode(["message" => "Wrong file type gameFile"]);
exit();
@@ -39,17 +39,17 @@ function imagesFileHandler(string $thumbnailFileName, string $thumbnailFileTmp):
$fileActualExtThumb = strtolower(end($fileExtThumb));
$headerType = mime_content_type($thumbnailFileTmp);
$headerTypeMatch = array('image/png', 'image/jpeg','image/gif', 'image/svg+xml',);
$headerTypeMatch = array('image/png', 'image/jpeg', 'image/gif', 'image/svg+xml',);
if(in_array($headerType,$headerTypeMatch)){
$thumbnailFileNewName = uniqid("", true). "." . $fileActualExtThumb;
if(empty($thumbnailFileName)){
if (in_array($headerType, $headerTypeMatch)) {
$thumbnailFileNewName = uniqid("", true) . "." . $fileActualExtThumb;
if (empty($thumbnailFileName)) {
http_response_code(400);
exit();
}
rename($thumbnailFileTmp,"../../../Frontend/images/".$thumbnailFileNewName);
rename($thumbnailFileTmp, "../../../Frontend/images/" . $thumbnailFileNewName);
return $thumbnailFileNewName;
}else{
} else {
http_response_code(400);
echo json_encode(["message" => "Wrong file type thumbnailFile"]);
exit();