diff options
Diffstat (limited to 'download_remailers.php')
| -rw-r--r-- | download_remailers.php | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/download_remailers.php b/download_remailers.php index 3b40607..d601ac6 100644 --- a/download_remailers.php +++ b/download_remailers.php @@ -61,9 +61,9 @@ class SecureRemailerDownloader { /** * Download remailer stats (mlist.txt) */ - private function downloadStats() { + private function downloadStats(bool $force = false) { // Check if update is needed (with randomized interval) - if (!$this->needsUpdate($this->remailersFile)) { + if (!$force && !$this->needsUpdate($this->remailersFile)) { $this->log("Stats update not needed yet"); return true; } @@ -109,9 +109,9 @@ class SecureRemailerDownloader { /** * Download public keyring (pubring.mix) */ - private function downloadKeyring() { + private function downloadKeyring(bool $force = false) { // Check if update is needed (with randomized interval) - if (!$this->needsUpdate($this->pubringFile)) { + if (!$force && !$this->needsUpdate($this->pubringFile)) { $this->log("Keyring update not needed yet"); return true; } @@ -538,8 +538,8 @@ class SecureRemailerDownloader { * Force update of both stats and keyring */ public function forceUpdate() { - $statsResult = $this->downloadStats(); - $keyringResult = $this->downloadKeyring(); + $statsResult = $this->downloadStats(true); + $keyringResult = $this->downloadKeyring(true); return $statsResult && $keyringResult; } @@ -572,12 +572,4 @@ class SecureRemailerDownloader { } } -// Usage -try { - $downloader = new SecureRemailerDownloader(); - $downloader->downloadRemailers(); -} catch (Exception $e) { - error_log("Remailer download failed: " . $e->getMessage()); -} ?> - |
