‪TYPO3CMS  10.4
FileStorageIndexingTask.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
22 
28 {
34  public ‪$storageUid = -1;
35 
41  public function ‪execute()
42  {
43  if ((int)$this->storageUid > 0) {
44  $storage = GeneralUtility::makeInstance(ResourceFactory::class)->getStorageObject($this->storageUid);
45  $currentEvaluatePermissionsValue = $storage->getEvaluatePermissions();
46  $storage->setEvaluatePermissions(false);
47  $indexer = $this->‪getIndexer($storage);
48  $indexer->processChangesInStorages();
49  $storage->setEvaluatePermissions($currentEvaluatePermissionsValue);
50  }
51  return true;
52  }
53 
60  protected function ‪getIndexer(‪ResourceStorage $storage)
61  {
62  return GeneralUtility::makeInstance(Indexer::class, $storage);
63  }
64 }
‪TYPO3\CMS\Core\Resource\Index\Indexer
Definition: Indexer.php:34
‪TYPO3\CMS\Scheduler\Task
Definition: AbstractTask.php:16
‪TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask\execute
‪bool execute()
Definition: FileStorageIndexingTask.php:40
‪TYPO3\CMS\Scheduler\Task\AbstractTask
Definition: AbstractTask.php:35
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask
Definition: FileStorageIndexingTask.php:28
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:122
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask\getIndexer
‪TYPO3 CMS Core Resource Index Indexer getIndexer(ResourceStorage $storage)
Definition: FileStorageIndexingTask.php:59
‪TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask\$storageUid
‪int $storageUid
Definition: FileStorageIndexingTask.php:33