|
|
@ -360,6 +360,63 @@ class MySQL { |
|
|
|
return $query->fetchAll(); |
|
|
|
return $query->fetchAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function addHostPageSnapURL(int $hostPageId, |
|
|
|
|
|
|
|
int $crc32data, |
|
|
|
|
|
|
|
int $crc32host, |
|
|
|
|
|
|
|
string $url, |
|
|
|
|
|
|
|
int $timeAdded) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('INSERT IGNORE INTO `hostPageSnapURL` (`hostPageId`, |
|
|
|
|
|
|
|
`crc32data`, |
|
|
|
|
|
|
|
`crc32host`, |
|
|
|
|
|
|
|
`url`, |
|
|
|
|
|
|
|
`timeAdded`) VALUES (?, ?, ?, ?, ?)'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->execute([$hostPageId, |
|
|
|
|
|
|
|
$crc32data, |
|
|
|
|
|
|
|
$crc32host, |
|
|
|
|
|
|
|
$url, |
|
|
|
|
|
|
|
$timeAdded]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $query->rowCount(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function deleteHostPageSnapURL(int $hostPageId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('DELETE FROM `hostPageSnapURL` WHERE `hostPageId` = ?'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->execute([$hostPageId]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $query->rowCount(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getTotalHostPageSnapURLs(int $hostPageId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `hostPageSnapURL` WHERE `hostPageId` = ?'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->execute([$hostPageId]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $query->fetch()->total; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getHostPageSnapURLs(int $hostPageId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('SELECT * FROM `hostPageSnapURL` WHERE `hostPageId` = ? ORDER BY `timeAdded` DESC'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->execute([$hostPageId]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $query->fetchAll(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getHostPageSnapURL(int $hostPageId, int $crc32data, int $crc32host) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('SELECT * FROM `hostPageSnapURL` WHERE `hostPageId` = ? AND `hostPageId` = ? AND `crc32host` = ? LIMIT 1'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->execute([$hostPageId, $crc32data, $crc32host]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $query->fetch(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Cleaner tools |
|
|
|
// Cleaner tools |
|
|
|
public function getCleanerQueue(int $limit, int $timeFrom) { |
|
|
|
public function getCleanerQueue(int $limit, int $timeFrom) { |
|
|
|
|
|
|
|
|
|
|
@ -398,7 +455,9 @@ class MySQL { |
|
|
|
int $hostsTotal, |
|
|
|
int $hostsTotal, |
|
|
|
int $hostsUpdated, |
|
|
|
int $hostsUpdated, |
|
|
|
int $hostPagesDeleted, |
|
|
|
int $hostPagesDeleted, |
|
|
|
int $hostPageDescriptionsDeleted, |
|
|
|
int $hostPagesDescriptionsDeleted, |
|
|
|
|
|
|
|
int $hostPagesSnapUrlDeleted, |
|
|
|
|
|
|
|
int $hostPagesToHostPageDeleted, |
|
|
|
int $hostPagesBansRemoved, |
|
|
|
int $hostPagesBansRemoved, |
|
|
|
int $manifestsTotal, |
|
|
|
int $manifestsTotal, |
|
|
|
int $manifestsDeleted, |
|
|
|
int $manifestsDeleted, |
|
|
@ -414,7 +473,9 @@ class MySQL { |
|
|
|
`hostsTotal`, |
|
|
|
`hostsTotal`, |
|
|
|
`hostsUpdated`, |
|
|
|
`hostsUpdated`, |
|
|
|
`hostPagesDeleted`, |
|
|
|
`hostPagesDeleted`, |
|
|
|
`hostPageDescriptionsDeleted`, |
|
|
|
`hostPagesDescriptionsDeleted`, |
|
|
|
|
|
|
|
`hostPagesSnapUrlDeleted`, |
|
|
|
|
|
|
|
`hostPagesToHostPageDeleted`, |
|
|
|
`hostPagesBansRemoved`, |
|
|
|
`hostPagesBansRemoved`, |
|
|
|
`manifestsTotal`, |
|
|
|
`manifestsTotal`, |
|
|
|
`manifestsDeleted`, |
|
|
|
`manifestsDeleted`, |
|
|
@ -424,14 +485,16 @@ class MySQL { |
|
|
|
`httpRequestsSizeTotal`, |
|
|
|
`httpRequestsSizeTotal`, |
|
|
|
`httpDownloadSizeTotal`, |
|
|
|
`httpDownloadSizeTotal`, |
|
|
|
`httpRequestsTimeTotal`, |
|
|
|
`httpRequestsTimeTotal`, |
|
|
|
`executionTimeTotal`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); |
|
|
|
`executionTimeTotal`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); |
|
|
|
|
|
|
|
|
|
|
|
$query->execute([ |
|
|
|
$query->execute([ |
|
|
|
$timeAdded, |
|
|
|
$timeAdded, |
|
|
|
$hostsTotal, |
|
|
|
$hostsTotal, |
|
|
|
$hostsUpdated, |
|
|
|
$hostsUpdated, |
|
|
|
$hostPagesDeleted, |
|
|
|
$hostPagesDeleted, |
|
|
|
$hostPageDescriptionsDeleted, |
|
|
|
$hostPagesDescriptionsDeleted, |
|
|
|
|
|
|
|
$hostPagesSnapUrlDeleted, |
|
|
|
|
|
|
|
$hostPagesToHostPageDeleted, |
|
|
|
$hostPagesBansRemoved, |
|
|
|
$hostPagesBansRemoved, |
|
|
|
$manifestsTotal, |
|
|
|
$manifestsTotal, |
|
|
|
$manifestsDeleted, |
|
|
|
$manifestsDeleted, |
|
|
@ -523,6 +586,7 @@ class MySQL { |
|
|
|
int $hostPagesProcessed, |
|
|
|
int $hostPagesProcessed, |
|
|
|
int $hostPagesIndexed, |
|
|
|
int $hostPagesIndexed, |
|
|
|
int $hostPagesAdded, |
|
|
|
int $hostPagesAdded, |
|
|
|
|
|
|
|
int $hostPagesSnapUrlAdded, |
|
|
|
int $hostPagesBanned, |
|
|
|
int $hostPagesBanned, |
|
|
|
int $manifestsProcessed, |
|
|
|
int $manifestsProcessed, |
|
|
|
int $manifestsAdded, |
|
|
|
int $manifestsAdded, |
|
|
@ -537,6 +601,7 @@ class MySQL { |
|
|
|
`hostPagesProcessed`, |
|
|
|
`hostPagesProcessed`, |
|
|
|
`hostPagesIndexed`, |
|
|
|
`hostPagesIndexed`, |
|
|
|
`hostPagesAdded`, |
|
|
|
`hostPagesAdded`, |
|
|
|
|
|
|
|
`hostPagesSnapUrlAdded`, |
|
|
|
`hostPagesBanned`, |
|
|
|
`hostPagesBanned`, |
|
|
|
`manifestsProcessed`, |
|
|
|
`manifestsProcessed`, |
|
|
|
`manifestsAdded`, |
|
|
|
`manifestsAdded`, |
|
|
@ -544,7 +609,7 @@ class MySQL { |
|
|
|
`httpRequestsSizeTotal`, |
|
|
|
`httpRequestsSizeTotal`, |
|
|
|
`httpDownloadSizeTotal`, |
|
|
|
`httpDownloadSizeTotal`, |
|
|
|
`httpRequestsTimeTotal`, |
|
|
|
`httpRequestsTimeTotal`, |
|
|
|
`executionTimeTotal`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); |
|
|
|
`executionTimeTotal`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); |
|
|
|
|
|
|
|
|
|
|
|
$query->execute([ |
|
|
|
$query->execute([ |
|
|
|
$timeAdded, |
|
|
|
$timeAdded, |
|
|
@ -552,6 +617,7 @@ class MySQL { |
|
|
|
$hostPagesProcessed, |
|
|
|
$hostPagesProcessed, |
|
|
|
$hostPagesIndexed, |
|
|
|
$hostPagesIndexed, |
|
|
|
$hostPagesAdded, |
|
|
|
$hostPagesAdded, |
|
|
|
|
|
|
|
$hostPagesSnapUrlAdded, |
|
|
|
$hostPagesBanned, |
|
|
|
$hostPagesBanned, |
|
|
|
$manifestsProcessed, |
|
|
|
$manifestsProcessed, |
|
|
|
$manifestsAdded, |
|
|
|
$manifestsAdded, |
|
|
|