‪TYPO3CMS  10.4
CrawlerFilesHook.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 
20 
28 {
36  public function ‪crawler_execute($params, &$pObj)
37  {
38  if (!is_array($params['conf'])) {
39  return;
40  }
41  $indexerObj = GeneralUtility::makeInstance(Indexer::class);
42  $indexerObj->init($params['conf']);
43  // Index document:
44  if ($params['alturl']) {
45  $fI = pathinfo($params['document']);
46  $ext = strtolower($fI['extension']);
47  $indexerObj->indexRegularDocument($params['alturl'], true, $params['document'], $ext);
48  } else {
49  $indexerObj->indexRegularDocument($params['document'], true);
50  }
51  // Return OK:
52  return ['content' => []];
53  }
54 }
‪TYPO3\CMS\IndexedSearch\Hook\CrawlerFilesHook\crawler_execute
‪array null crawler_execute($params, &$pObj)
Definition: CrawlerFilesHook.php:36
‪TYPO3\CMS\IndexedSearch\Hook\CrawlerFilesHook
Definition: CrawlerFilesHook.php:28
‪TYPO3\CMS\IndexedSearch\Indexer
Definition: Indexer.php:37
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\IndexedSearch\Hook
Definition: CrawlerFilesHook.php:16