From 1e0eb013596a509a8de25bfa979d489b1fb9e7dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 9 Jun 2021 10:46:28 +0200 Subject: [PATCH] Delete DownloadRankImageJob see 60cb68989dc3968a0a29eb71f00c16645b5f63f3 --- .../job/DownloadRankImageJob.class.php | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 wcfsetup/install/files/lib/system/background/job/DownloadRankImageJob.class.php diff --git a/wcfsetup/install/files/lib/system/background/job/DownloadRankImageJob.class.php b/wcfsetup/install/files/lib/system/background/job/DownloadRankImageJob.class.php deleted file mode 100644 index 3145bc40e1..0000000000 --- a/wcfsetup/install/files/lib/system/background/job/DownloadRankImageJob.class.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @package WoltLabSuite\Core\System\Background\Job - * @since 5.4 - * @deprecated 5.4 - This background job is used for the upgrade from 5.3 to 5.4 and will be removed with 5.5. - */ -class DownloadRankImageJob extends AbstractBackgroundJob -{ - /** - * @inheritDoc - */ - const MAX_FAILURES = 5; - - /** - * @var int - */ - protected $userRankID; - - public function __construct(UserRank $userRank) - { - $this->userRankID = $userRank->rankID; - } - - /** - * @return int every 10 minutes - */ - public function retryAfter() - { - return 10 * 60; - } - - /** - * @inheritDoc - */ - public function perform() - { - $rank = new UserRank($this->userRankID); - if (!$rank->rankID) { - return; - } - if (empty($rank->rankImage)) { - return; - } - if (!Url::is($rank->rankImage)) { - return; - } - - $rankEditor = new UserRankEditor($rank); - - $extension = \pathinfo(Url::parse($rank->rankImage)['path'], \PATHINFO_EXTENSION); - if (\in_array($extension, ['gif', 'png', 'jpg', 'jpeg', 'svg', 'webp'])) { - $http = HttpFactory::makeClientWithTimeout(10); - - $imageDest = WCF_DIR . UserRank::RANK_IMAGE_DIR . $rank->rankID . '-rankImage.' . $extension; - $http->send(new Request('GET', $rank->rankImage), [ - 'sink' => $imageDest, - ]); - - $rankEditor->update([ - 'rankImage' => \basename($imageDest), - ]); - } else { - $rankEditor->update([ - 'rankImage' => "", - ]); - } - } -} -- 2.20.1