TYPO3 CMS  TYPO3_6-2
FileStorageExtractionTask.php
Go to the documentation of this file.
1 <?php
3 
22 
28  public $storageUid = -1;
29 
34  public $maxFileCount = 100;
35 
41  public function execute() {
42  $success = FALSE;
43  if ((int)$this->storageUid > 0) {
44  $storage = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getStorageObject($this->storageUid);
45  $storage->setEvaluatePermissions(FALSE);
46  $indexer = $this->getIndexer($storage);
47  try {
48  $indexer->runMetaDataExtraction((int)$this->maxFileCount);
49  $success = TRUE;
50  } catch (\Exception $e) {
51  $success = FALSE;
52  }
53  $storage->setEvaluatePermissions(TRUE);
54  }
55  return $success;
56  }
57 
64  protected function getIndexer(\TYPO3\CMS\Core\Resource\ResourceStorage $storage) {
65  return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Index\\Indexer', $storage);
66  }
67 
68 }
getIndexer(\TYPO3\CMS\Core\Resource\ResourceStorage $storage)