Merge pull request #5951 from WoltLab/upload-form-field-v2
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / worker / FileRebuildDataWorker.class.php
1 <?php
2
3 namespace wcf\system\worker;
4
5 use wcf\data\file\FileList;
6 use wcf\system\file\processor\FileProcessor;
7
8 /**
9 * Worker implementation for updating files.
10 *
11 * @author Alexander Ebert
12 * @copyright 2001-2014 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @since 6.1
15 *
16 * @method FileList getObjectList()
17 * @property-read FileList $objectList
18 */
19 final class FileRebuildDataWorker extends AbstractLinearRebuildDataWorker
20 {
21 /**
22 * @inheritDoc
23 */
24 protected $objectListClassName = FileList::class;
25
26 /**
27 * @inheritDoc
28 */
29 protected $limit = 10;
30
31 #[\Override]
32 protected function initObjectList()
33 {
34 parent::initObjectList();
35
36 $this->objectList->sqlOrderBy = 'file.fileID';
37 }
38
39 #[\Override]
40 public function execute()
41 {
42 parent::execute();
43
44 foreach ($this->objectList as $file) {
45 FileProcessor::getInstance()->generateWebpVariant($file);
46 FileProcessor::getInstance()->generateThumbnails($file);
47 }
48 }
49 }