1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace AOE\Crawler\Backend\RequestForm; |
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\Value\CrawlAction; |
23
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility; |
24
|
|
|
use TYPO3\CMS\Fluid\View\StandaloneView; |
25
|
|
|
use TYPO3\CMS\Info\Controller\InfoModuleController; |
26
|
|
|
|
27
|
|
|
final class RequestFormFactory |
28
|
|
|
{ |
29
|
1 |
|
public static function create(CrawlAction $selectedAction, StandaloneView $view, InfoModuleController $infoModuleController, array $extensionSettings): RequestFormInterface |
30
|
|
|
{ |
31
|
1 |
|
switch ($selectedAction->__toString()) { |
32
|
1 |
|
case 'log': |
33
|
|
|
/** @var RequestFormInterface $requestForm */ |
34
|
1 |
|
$requestForm = GeneralUtility::makeInstance(LogRequestForm::class, $view, $infoModuleController, $extensionSettings); |
35
|
1 |
|
break; |
36
|
1 |
|
case 'multiprocess': |
37
|
1 |
|
$requestForm = GeneralUtility::makeInstance(MultiProcessRequestForm::class, $view, $infoModuleController, $extensionSettings); |
38
|
1 |
|
break; |
39
|
1 |
|
case 'start': |
40
|
|
|
default: |
41
|
1 |
|
$requestForm = GeneralUtility::makeInstance(StartRequestForm::class, $view, $infoModuleController, $extensionSettings); |
42
|
|
|
} |
43
|
|
|
|
44
|
1 |
|
return $requestForm; |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|