mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-24 13:34:25 +00:00
add httpCode column to hostPageSnapDownload table
This commit is contained in:
parent
20726fca45
commit
7892784f5c
Binary file not shown.
@ -456,11 +456,11 @@ class MySQL {
|
||||
return $this->_db->lastInsertId();
|
||||
}
|
||||
|
||||
public function updateHostPageSnapDownload(int $hostPageSnapDownloadId, string $storage, int $size) {
|
||||
public function updateHostPageSnapDownload(int $hostPageSnapDownloadId, string $storage, int $size, mixed $httpCode = NULL) {
|
||||
|
||||
$query = $this->_db->prepare('UPDATE `hostPageSnapDownload` SET `storage` = ?, `size` = ? WHERE `hostPageSnapDownloadId` = ? LIMIT 1');
|
||||
$query = $this->_db->prepare('UPDATE `hostPageSnapDownload` SET `storage` = ?, `size` = ?, `httpCode` = ? WHERE `hostPageSnapDownloadId` = ? LIMIT 1');
|
||||
|
||||
$query->execute([$storage, $size, $hostPageSnapDownloadId]);
|
||||
$query->execute([$storage, $size, $httpCode, $hostPageSnapDownloadId]);
|
||||
|
||||
return $query->rowCount();
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 181 KiB |
@ -78,7 +78,7 @@ switch ($type) {
|
||||
|
||||
$snapSize = (int) @filesize('../storage/snap/' . $snapFile);
|
||||
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'local', $snapSize);
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'local', $snapSize, 200);
|
||||
|
||||
header('Content-Type: application/zip');
|
||||
header(sprintf('Content-Length: %s', $snapSize));
|
||||
@ -96,7 +96,7 @@ switch ($type) {
|
||||
|
||||
if ($snapSize = $ftp->size($snapFile)) {
|
||||
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'mega', $snapSize);
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'mega', $snapSize, 200);
|
||||
|
||||
header('Content-Type: application/zip');
|
||||
header(sprintf('Content-Length: %s', $snapSize));
|
||||
@ -108,7 +108,7 @@ switch ($type) {
|
||||
|
||||
} else {
|
||||
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'mega', $snapSize);
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'mega', $snapSize, 404);
|
||||
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
|
||||
@ -117,7 +117,7 @@ switch ($type) {
|
||||
|
||||
} else {
|
||||
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'mega', $snapSize);
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'mega', $snapSize, 404);
|
||||
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
|
||||
@ -127,7 +127,7 @@ switch ($type) {
|
||||
// Return 404 when file not found
|
||||
} else {
|
||||
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'other', $snapSize);
|
||||
$db->updateHostPageSnapDownload($hostPageSnapDownloadId, 'other', $snapSize, 404);
|
||||
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user