1
|
|
|
<?php |
2
|
|
|
namespace ApacheSolrForTypo3\Solr\System\Mvc\Frontend\Controller; |
3
|
|
|
|
4
|
|
|
/*************************************************************** |
5
|
|
|
* Copyright notice |
6
|
|
|
* |
7
|
|
|
* (c) 2010-2017 dkd Internet Service GmbH <[email protected]> |
8
|
|
|
* All rights reserved |
9
|
|
|
* |
10
|
|
|
* This script is part of the TYPO3 project. The TYPO3 project is |
11
|
|
|
* free software; you can redistribute it and/or modify |
12
|
|
|
* it under the terms of the GNU General Public License as published by |
13
|
|
|
* the Free Software Foundation; either version 3 of the License, or |
14
|
|
|
* (at your option) any later version. |
15
|
|
|
* |
16
|
|
|
* The GNU General Public License can be found at |
17
|
|
|
* http://www.gnu.org/copyleft/gpl.html. |
18
|
|
|
* |
19
|
|
|
* This script is distributed in the hope that it will be useful, |
20
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
21
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22
|
|
|
* GNU General Public License for more details. |
23
|
|
|
* |
24
|
|
|
* This copyright notice MUST APPEAR in all copies of the script! |
25
|
|
|
***************************************************************/ |
26
|
|
|
|
27
|
|
|
use ApacheSolrForTypo3\Solr\IndexQueue\Exception\DocumentPreparationException; |
28
|
|
|
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Overrides TYPO3 CMS TypoScriptFrontendController TSFE to prevent PHP on indexing processes from dieing. |
32
|
|
|
*/ |
33
|
|
|
class OverriddenTypoScriptFrontendController extends TypoScriptFrontendController |
34
|
|
|
{ |
35
|
|
|
/** |
36
|
|
|
* Page unavailable handler for use in frontend plugins from extensions. |
37
|
|
|
* |
38
|
|
|
* @param string $reason Reason text |
39
|
|
|
* @param string $header HTTP header to send |
40
|
|
|
* @throws DocumentPreparationException |
41
|
|
|
*/ |
42
|
|
|
public function pageUnavailableAndExit($reason = '', $header = '') |
43
|
|
|
{ |
44
|
|
|
if (!defined('EXT_SOLR_INDEXING_CONTEXT')) { |
45
|
|
|
parent::pageUnavailableAndExit($reason, $header); |
|
|
|
|
46
|
|
|
} |
47
|
|
|
throw new DocumentPreparationException('Solr Document can not be prepared. The Reason: ' . $reason, 1517584040); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Page-not-found handler for use in frontend plugins from extensions. |
52
|
|
|
* |
53
|
|
|
* @param string $reason Reason text |
54
|
|
|
* @param string $header HTTP header to send |
55
|
|
|
* @throws DocumentPreparationException |
56
|
|
|
*/ |
57
|
1 |
|
public function pageNotFoundAndExit($reason = '', $header = '') |
58
|
|
|
{ |
59
|
1 |
|
if (!defined('EXT_SOLR_INDEXING_CONTEXT')) { |
60
|
|
|
parent::pageNotFoundAndExit($reason, $header); |
|
|
|
|
61
|
|
|
} |
62
|
1 |
|
throw new DocumentPreparationException('Solr Document can not be prepared. The Reason: ' . $reason, 1517584045); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|