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() |
|
90 | |||
91 | /** |
||
92 | * In the cli context TYPO3 has chance to determine the webroot. |
||
93 | * Since we need it for the TSFE related things we allow to set it |
||
94 | * in the scheduler task and use the ###PATH_typo3### marker in the |
||
95 | * setting to be able to define relative paths. |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 3 | public function getWebRoot() |
|
109 | |||
110 | /** |
||
111 | * @param string $webRoot |
||
112 | * @return string |
||
113 | */ |
||
114 | 1 | protected function replaceWebRootMarkers($webRoot) |
|
126 | |||
127 | /** |
||
128 | * Returns some additional information about indexing progress, shown in |
||
129 | * the scheduler's task overview list. |
||
130 | * |
||
131 | * @return string Information to display |
||
132 | */ |
||
133 | 1 | public function getAdditionalInformation() |
|
150 | |||
151 | /** |
||
152 | * Gets the indexing progress. |
||
153 | * |
||
154 | * @return float Indexing progress as a two decimal precision float. f.e. 44.87 |
||
155 | */ |
||
156 | 1 | public function getProgress() |
|
164 | |||
165 | /** |
||
166 | * Gets the site / the site's root page uid this task is indexing. |
||
167 | * |
||
168 | * @return Site The site's root page uid this task is indexing |
||
169 | */ |
||
170 | public function getSite() |
||
174 | |||
175 | /** |
||
176 | * Sets the task's site to indexing. |
||
177 | * |
||
178 | * @param Site $site The site to index by this task |
||
179 | * @return void |
||
180 | */ |
||
181 | 2 | public function setSite(Site $site) |
|
185 | |||
186 | /** |
||
187 | * @return mixed |
||
188 | */ |
||
189 | public function getDocumentsToIndexLimit() |
||
193 | |||
194 | /** |
||
195 | * @param int $limit |
||
196 | */ |
||
197 | 2 | public function setDocumentsToIndexLimit($limit) |
|
201 | |||
202 | /** |
||
203 | * @param string $forcedWebRoot |
||
204 | */ |
||
205 | 1 | public function setForcedWebRoot($forcedWebRoot) |
|
209 | |||
210 | /** |
||
211 | * @return string |
||
212 | */ |
||
213 | public function getForcedWebRoot() |
||
217 | } |
||
218 |