mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-02-03 10:25:52 +00:00
fix host page snap storage id
This commit is contained in:
parent
307eb03600
commit
3c4a89d16d
@ -53,26 +53,18 @@ switch ($type) {
|
|||||||
if ($hostPageSnap = $db->getHostPageSnap(!empty($_GET['hps']) ? (int) $_GET['hps'] : 0)) {
|
if ($hostPageSnap = $db->getHostPageSnap(!empty($_GET['hps']) ? (int) $_GET['hps'] : 0)) {
|
||||||
|
|
||||||
// Get snap file
|
// Get snap file
|
||||||
|
|
||||||
$snapStorageIndex = 0;
|
|
||||||
|
|
||||||
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
|
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
|
||||||
|
|
||||||
foreach ($storages as $storage) {
|
foreach ($storages as $i => $storage) {
|
||||||
|
|
||||||
$snapStorageIndex++;
|
|
||||||
|
|
||||||
// Generate storage id
|
// Generate storage id
|
||||||
$crc32name = crc32(sprintf('%s.%s', $name, $snapStorageIndex));
|
$crc32name = crc32(sprintf('%s.%s', $name, $i));
|
||||||
|
|
||||||
switch ($name) {
|
if ($hostPageSnapStorage = $db->getHostPageSnapStorageByCRC32Name($hostPageSnap->hostPageSnapId, $crc32name)) {
|
||||||
|
|
||||||
case 'localhost':
|
switch ($name) {
|
||||||
|
|
||||||
if ($hostPageSnapStorage = $db->getHostPageSnapStorageByCRC32Name($hostPageSnap->hostPageSnapId, $crc32name)) {
|
case 'localhost':
|
||||||
|
|
||||||
// Check request quota
|
|
||||||
//if ()
|
|
||||||
|
|
||||||
// Get file
|
// Get file
|
||||||
$snapFile = 'hp/' . chunk_split($hostPageSnap->hostPageId, 1, '/') . $hostPageSnap->timeAdded . '.zip';
|
$snapFile = 'hp/' . chunk_split($hostPageSnap->hostPageId, 1, '/') . $hostPageSnap->timeAdded . '.zip';
|
||||||
@ -94,12 +86,9 @@ switch ($type) {
|
|||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'ftp':
|
case 'ftp':
|
||||||
|
|
||||||
if ($hostPageSnapStorage = $db->getHostPageSnapStorageByCRC32Name($hostPageSnap->hostPageSnapId, $crc32name)) {
|
|
||||||
|
|
||||||
$ftp = new Ftp();
|
$ftp = new Ftp();
|
||||||
|
|
||||||
@ -121,9 +110,9 @@ switch ($type) {
|
|||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user