1 | <?php |
||
40 | class IndexQueueWorkerTask extends AbstractTask implements ProgressProviderInterface |
||
41 | { |
||
42 | |||
43 | /** |
||
44 | * The site this task is indexing. |
||
45 | * |
||
46 | * @var Site |
||
47 | */ |
||
48 | protected $site; |
||
49 | |||
50 | /** |
||
51 | * @var int |
||
52 | */ |
||
53 | protected $documentsToIndexLimit; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $forcedWebRoot = ''; |
||
59 | |||
60 | /** |
||
61 | * Works through the indexing queue and indexes the queued items into Solr. |
||
62 | * |
||
63 | * @return bool Returns TRUE on success, FALSE if no items were indexed or none were found. |
||
64 | */ |
||
65 | 1 | public function execute() |
|
89 | |||
90 | /** |
||
91 | * In the cli context TYPO3 has chance to determine the webroot. |
||
92 | * Since we need it for the TSFE related things we allow to set it |
||
93 | * in the scheduler task and use the ###PATH_typo3### marker in the |
||
94 | * setting to be able to define relative paths. |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | 3 | public function getWebRoot() |
|
108 | |||
109 | /** |
||
110 | * @param string $webRoot |
||
111 | * @return string |
||
112 | */ |
||
113 | 1 | protected function replaceWebRootMarkers($webRoot) |
|
125 | |||
126 | /** |
||
127 | * Returns some additional information about indexing progress, shown in |
||
128 | * the scheduler's task overview list. |
||
129 | * |
||
130 | * @return string Information to display |
||
131 | */ |
||
132 | 1 | public function getAdditionalInformation() |
|
148 | |||
149 | /** |
||
150 | * Gets the indexing progress. |
||
151 | * |
||
152 | * @return float Indexing progress as a two decimal precision float. f.e. 44.87 |
||
153 | */ |
||
154 | 1 | public function getProgress() |
|
161 | |||
162 | /** |
||
163 | * Gets the site / the site's root page uid this task is indexing. |
||
164 | * |
||
165 | * @return Site The site's root page uid this task is indexing |
||
166 | */ |
||
167 | public function getSite() |
||
171 | |||
172 | /** |
||
173 | * Sets the task's site to indexing. |
||
174 | * |
||
175 | * @param Site $site The site to index by this task |
||
176 | * @return void |
||
177 | */ |
||
178 | 2 | public function setSite(Site $site) |
|
182 | |||
183 | /** |
||
184 | * @return mixed |
||
185 | */ |
||
186 | public function getDocumentsToIndexLimit() |
||
190 | |||
191 | /** |
||
192 | * @param int $limit |
||
193 | */ |
||
194 | 2 | public function setDocumentsToIndexLimit($limit) |
|
198 | |||
199 | /** |
||
200 | * @param string $forcedWebRoot |
||
201 | */ |
||
202 | 1 | public function setForcedWebRoot($forcedWebRoot) |
|
206 | |||
207 | /** |
||
208 | * @return string |
||
209 | */ |
||
210 | public function getForcedWebRoot() |
||
214 | |||
215 | /** |
||
216 | * Returns the initialize IndexService instance. |
||
217 | * |
||
218 | * @return IndexService |
||
219 | */ |
||
220 | 2 | protected function getInitializedIndexService() |
|
226 | } |
||
227 |