1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace AOE\Crawler\Worker; |
6
|
|
|
|
7
|
|
|
/* |
8
|
|
|
* (c) 2020 AOE GmbH <[email protected]> |
9
|
|
|
* |
10
|
|
|
* This file is part of the TYPO3 Crawler Extension. |
11
|
|
|
* |
12
|
|
|
* It is free software; you can redistribute it and/or modify it under |
13
|
|
|
* the terms of the GNU General Public License, either version 2 |
14
|
|
|
* of the License, or any later version. |
15
|
|
|
* |
16
|
|
|
* For the full copyright and license information, please read the |
17
|
|
|
* LICENSE.txt file that was distributed with this source code. |
18
|
|
|
* |
19
|
|
|
* The TYPO3 project - inspiring people to share! |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
use AOE\Crawler\Controller\CrawlerController; |
23
|
|
|
use AOE\Crawler\Hooks\IndexedSearchCrawlerFilesHook; |
24
|
|
|
use TYPO3\CMS\Core\TimeTracker\TimeTracker; |
25
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility; |
26
|
|
|
use TYPO3\CMS\IndexedSearch\Worker\WorkerInterface; |
|
|
|
|
27
|
|
|
|
28
|
|
|
class CrawlerWorker implements WorkerInterface |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* CrawlerWorker constructor. |
32
|
|
|
*/ |
33
|
|
|
public function __construct() |
34
|
|
|
{ |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @param object $caller Method caller |
39
|
|
|
* @param array $conf Indexed search configuration |
40
|
|
|
* @param string $file Relative Filename, relative to public web path. It can also be an absolute path as long as it is inside the lockRootPath (validated with \TYPO3\CMS\Core\Utility\GeneralUtility::isAbsPath()). Finally, if $contentTmpFile is set, this value can be anything, most likely a URL |
41
|
|
|
* @param string $contentTmpFile Temporary file with the content to read it from (instead of $file). Used when the $file is a URL. |
42
|
|
|
* @param string $fileExtension File extension for temporary file. |
43
|
|
|
* @return mixed |
44
|
|
|
*/ |
45
|
|
|
public function index(object $caller, array $conf, string $file, string $contentTmpFile = '', $fileExtension = '') |
46
|
|
|
{ |
47
|
|
|
$crawler = GeneralUtility::makeInstance(CrawlerController::class); |
48
|
|
|
|
49
|
|
|
$params = [ |
50
|
|
|
'document' => $contentTmpFile, |
51
|
|
|
'alturl' => $file, |
52
|
|
|
'conf' => $conf, |
53
|
|
|
]; |
54
|
|
|
|
55
|
|
|
unset($params['conf']['content']); |
56
|
|
|
|
57
|
|
|
$crawler->addQueueEntry_callBack(0, $params, IndexedSearchCrawlerFilesHook::class, $conf['id']); |
58
|
|
|
|
59
|
|
|
GeneralUtility::makeInstance(TimeTracker::class)->setTSlogMessage('media "' . $params['document'] . '" added to "crawler" queue.', 1); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths