@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | 2 | $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler'); |
3 | 3 | return [ |
4 | - 'tx_crawler_lib' => $extensionPath . 'class.tx_crawler_lib.php', |
|
5 | - 'tx_crawler_cli_flush' => $extensionPath . 'cli/class.tx_crawler_cli_flush.php', |
|
6 | - 'tx_crawler_cli' => $extensionPath . 'cli/class.tx_crawler_cli.php', |
|
7 | - 'tx_crawler_cli_im' => $extensionPath . 'cli/class.tx_crawler_cli_im.php', |
|
8 | - 'tx_crawler_domain_events_dispatcher' => $extensionPath . 'domain/events/class.tx_crawler_domain_events_dispatcher.php', |
|
9 | - 'tx_crawler_domain_events_observer' => $extensionPath . 'domain/events/interface.tx_crawler_domain_events_observer.php', |
|
10 | - 'tx_crawler_domain_lib_abstract_dbobject' => $extensionPath . 'domain/lib/class.tx_crawler_domain_lib_abstract_dbobject.php', |
|
11 | - 'tx_crawler_domain_process_manager' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_manager.php', |
|
12 | - 'tx_crawler_domain_process' => $extensionPath . 'domain/process/class.tx_crawler_domain_process.php', |
|
13 | - 'tx_crawler_domain_process_collection' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_collection.php', |
|
14 | - 'tx_crawler_domain_process_repository' => $extensionPath . 'domain/process/class.tx_crawler_domain_process_repository.php', |
|
15 | - 'tx_crawler_domain_queue_entry' => $extensionPath . 'domain/queue/class.tx_crawler_domain_queue_entry.php', |
|
16 | - 'tx_crawler_domain_queue_repository' => $extensionPath . 'domain/queue/class.tx_crawler_domain_queue_repository.php', |
|
17 | - 'tx_crawler_domain_reason' => $extensionPath . 'domain/reason/class.tx_crawler_domain_reason.php', |
|
18 | - 'tx_crawler_hooks_tsfe' => $extensionPath . 'hooks/class.tx_crawler_hooks_tsfe.php', |
|
19 | - 'tx_crawler_hooks_staticFileCacheCreateUri' => $extensionPath . 'hooks/class.tx_crawler_hooks_staticFileCacheCreateUri.php', |
|
20 | - 'tx_crawler_hooks_processCleanUp' => $extensionPath . 'hooks/class.tx_crawler_hooks_processCleanUp.php', |
|
21 | - 'tx_crawler_modfunc1' => $extensionPath . 'modfunc1/class.tx_crawler_modfunc1.php', |
|
22 | - 'tx_crawler_view_pagination' => $extensionPath . 'view/class.tx_crawler_view_pagination.php', |
|
23 | - 'tx_crawler_view_process_list' => $extensionPath . 'view/process/class.tx_crawler_view_process_list.php', |
|
4 | + 'tx_crawler_lib' => $extensionPath.'class.tx_crawler_lib.php', |
|
5 | + 'tx_crawler_cli_flush' => $extensionPath.'cli/class.tx_crawler_cli_flush.php', |
|
6 | + 'tx_crawler_cli' => $extensionPath.'cli/class.tx_crawler_cli.php', |
|
7 | + 'tx_crawler_cli_im' => $extensionPath.'cli/class.tx_crawler_cli_im.php', |
|
8 | + 'tx_crawler_domain_events_dispatcher' => $extensionPath.'domain/events/class.tx_crawler_domain_events_dispatcher.php', |
|
9 | + 'tx_crawler_domain_events_observer' => $extensionPath.'domain/events/interface.tx_crawler_domain_events_observer.php', |
|
10 | + 'tx_crawler_domain_lib_abstract_dbobject' => $extensionPath.'domain/lib/class.tx_crawler_domain_lib_abstract_dbobject.php', |
|
11 | + 'tx_crawler_domain_process_manager' => $extensionPath.'domain/process/class.tx_crawler_domain_process_manager.php', |
|
12 | + 'tx_crawler_domain_process' => $extensionPath.'domain/process/class.tx_crawler_domain_process.php', |
|
13 | + 'tx_crawler_domain_process_collection' => $extensionPath.'domain/process/class.tx_crawler_domain_process_collection.php', |
|
14 | + 'tx_crawler_domain_process_repository' => $extensionPath.'domain/process/class.tx_crawler_domain_process_repository.php', |
|
15 | + 'tx_crawler_domain_queue_entry' => $extensionPath.'domain/queue/class.tx_crawler_domain_queue_entry.php', |
|
16 | + 'tx_crawler_domain_queue_repository' => $extensionPath.'domain/queue/class.tx_crawler_domain_queue_repository.php', |
|
17 | + 'tx_crawler_domain_reason' => $extensionPath.'domain/reason/class.tx_crawler_domain_reason.php', |
|
18 | + 'tx_crawler_hooks_tsfe' => $extensionPath.'hooks/class.tx_crawler_hooks_tsfe.php', |
|
19 | + 'tx_crawler_hooks_staticFileCacheCreateUri' => $extensionPath.'hooks/class.tx_crawler_hooks_staticFileCacheCreateUri.php', |
|
20 | + 'tx_crawler_hooks_processCleanUp' => $extensionPath.'hooks/class.tx_crawler_hooks_processCleanUp.php', |
|
21 | + 'tx_crawler_modfunc1' => $extensionPath.'modfunc1/class.tx_crawler_modfunc1.php', |
|
22 | + 'tx_crawler_view_pagination' => $extensionPath.'view/class.tx_crawler_view_pagination.php', |
|
23 | + 'tx_crawler_view_process_list' => $extensionPath.'view/process/class.tx_crawler_view_process_list.php', |
|
24 | 24 | ]; |
@@ -201,15 +201,15 @@ discard block |
||
201 | 201 | 'index.php' |
202 | 202 | ); |
203 | 203 | |
204 | - $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
204 | + $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
205 | 205 | |
206 | 206 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
207 | 207 | |
208 | 208 | $h_func .= '<hr/>'. |
209 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], 'index.php', '&setID='.$setId) . ' - ' . |
|
210 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', '&setID='.$setId . $quiPart) . ' - ' . |
|
211 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', '&setID='.$setId . $quiPart) . ' - ' . |
|
212 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' . |
|
209 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], 'index.php', '&setID='.$setId).' - '. |
|
210 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', '&setID='.$setId.$quiPart).' - '. |
|
211 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', '&setID='.$setId.$quiPart).' - '. |
|
212 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': '. |
|
213 | 213 | \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
214 | 214 | $this->pObj->id, |
215 | 215 | 'SET[itemsPerPage]', |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $theOutput = $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); |
223 | 223 | |
224 | 224 | // Branch based on type: |
225 | - switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) { |
|
225 | + switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) { |
|
226 | 226 | case 'start': |
227 | 227 | if (empty($this->pObj->id)) { |
228 | 228 | $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected')); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download'); |
270 | 270 | $this->makeCrawlerProcessableChecks(); |
271 | 271 | |
272 | - switch ((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
272 | + switch ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
273 | 273 | case 'midnight': |
274 | 274 | $this->scheduledTime = mktime(0, 0, 0); |
275 | 275 | break; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | tx_crawler_domain_events_dispatcher::getInstance()->post( |
313 | 313 | 'invokeQueueChange', |
314 | 314 | $this->findCrawler()->setID, |
315 | - [ 'reason' => $reason ] |
|
315 | + ['reason' => $reason] |
|
316 | 316 | ); |
317 | 317 | } |
318 | 318 | |
@@ -396,11 +396,11 @@ discard block |
||
396 | 396 | $this->pObj->MOD_SETTINGS['depth'], |
397 | 397 | 0 |
398 | 398 | ); |
399 | - $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0); |
|
399 | + $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'] ? $this->pObj->MOD_SETTINGS['depth'] : 0); |
|
400 | 400 | |
401 | 401 | // Configurations |
402 | 402 | $cell[] = $this->selectorBox( |
403 | - empty($availableConfigurations)?[]:array_combine($availableConfigurations, $availableConfigurations), |
|
403 | + empty($availableConfigurations) ? [] : array_combine($availableConfigurations, $availableConfigurations), |
|
404 | 404 | 'configurationSelection', |
405 | 405 | $this->incomingConfigurationSelection, |
406 | 406 | 1 |
@@ -529,12 +529,12 @@ discard block |
||
529 | 529 | // Print rudimentary details: |
530 | 530 | $output .= ' |
531 | 531 | <br /><br /> |
532 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" /> |
|
533 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
534 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
532 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back').'" name="_back" /> |
|
533 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
534 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
535 | 535 | <br /> |
536 | - Current server time: ' . date('H:i:s', time()) . '<br />' . |
|
537 | - 'Status: ' . $resStatus . '<br />' . |
|
536 | + Current server time: ' . date('H:i:s', time()).'<br />'. |
|
537 | + 'Status: '.$resStatus.'<br />'. |
|
538 | 538 | \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
539 | 539 | } else { // Show list: |
540 | 540 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | foreach ($tree->tree as $data) { |
565 | 565 | $code .= $this->drawLog_addRows( |
566 | 566 | $data['row'], |
567 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true), |
|
567 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true), |
|
568 | 568 | intval($this->pObj->MOD_SETTINGS['itemsPerPage']) |
569 | 569 | ); |
570 | 570 | if (++$count == 1000) { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | $cc = 0; |
619 | 619 | foreach ($setList as $set) { |
620 | 620 | $code .= ' |
621 | - <tr class="bgColor'.($cc % 2 ? '-20':'-10').'"> |
|
621 | + <tr class="bgColor'.($cc % 2 ? '-20' : '-10').'"> |
|
622 | 622 | <td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td> |
623 | 623 | <td>'.$set['count_value'].'</td> |
624 | 624 | <td>'.\TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td> |
@@ -759,14 +759,14 @@ discard block |
||
759 | 759 | } |
760 | 760 | |
761 | 761 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
762 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
762 | + $refreshIcon = $GLOBALS['BACK_PATH'].'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
763 | 763 | |
764 | 764 | // Put rows together: |
765 | 765 | $content .= ' |
766 | - <tr class="bgColor'.($c % 2 ? '-20':'-10').'"> |
|
766 | + <tr class="bgColor'.($c % 2 ? '-20' : '-10').'"> |
|
767 | 767 | '.$titleClm.' |
768 | - <td><a href="' . $this->getModuleUrl(['qid_details' => $vv['qid'], 'setID' => $setId]) . '">'.htmlspecialchars($vv['qid']).'</a></td> |
|
769 | - <td><a href="' . $this->getModuleUrl(['qid_read' => $vv['qid'], 'setID' => $setId]) . '"><img src="' . $refreshIcon . '" width="14" hspace="1" vspace="2" height="14" border="0" title="'.htmlspecialchars('Read').'" alt="" /></a></td>'; |
|
768 | + <td><a href="' . $this->getModuleUrl(['qid_details' => $vv['qid'], 'setID' => $setId]).'">'.htmlspecialchars($vv['qid']).'</a></td> |
|
769 | + <td><a href="' . $this->getModuleUrl(['qid_read' => $vv['qid'], 'setID' => $setId]).'"><img src="'.$refreshIcon.'" width="14" hspace="1" vspace="2" height="14" border="0" title="'.htmlspecialchars('Read').'" alt="" /></a></td>'; |
|
770 | 770 | foreach ($rowData as $fKey => $value) { |
771 | 771 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) { |
772 | 772 | $content .= ' |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | |
985 | 985 | $exitCode = 0; |
986 | 986 | $out = []; |
987 | - exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode); |
|
987 | + exec(escapeshellcmd($this->extensionSettings['phpPath'].' -v'), $out, $exitCode); |
|
988 | 988 | if ($exitCode > 0) { |
989 | 989 | $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath']))); |
990 | 990 | } |
@@ -1173,10 +1173,10 @@ discard block |
||
1173 | 1173 | $options = []; |
1174 | 1174 | foreach ($optArray as $key => $val) { |
1175 | 1175 | $options[] = ' |
1176 | - <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>'; |
|
1176 | + <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array) $value)) ? ' selected="selected"' : '').'>'.htmlspecialchars($val).'</option>'; |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | - $output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>'; |
|
1179 | + $output = '<select name="'.htmlspecialchars($name.($multiple ? '[]' : '')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>'; |
|
1180 | 1180 | |
1181 | 1181 | return $output; |
1182 | 1182 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions'])) { |
41 | 41 | foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions'] as $key => $value) { |
42 | - $configuration['items'][] = [$value . ' [' . $key . ']', $key, $this->getExtensionIcon($key)]; |
|
42 | + $configuration['items'][] = [$value.' ['.$key.']', $key, $this->getExtensionIcon($key)]; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | if (method_exists('TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility', 'getExtensionKeyByPrefix')) { |
60 | 60 | $parts = explode('_', $key); |
61 | 61 | if (is_array($parts) && count($parts) > 2) { |
62 | - $extensionKey = ExtensionManagementUtility::getExtensionKeyByPrefix('tx_' . $parts[1]); |
|
63 | - $extIcon = ExtensionManagementUtility::siteRelPath($extensionKey) . 'ext_icon.gif'; |
|
62 | + $extensionKey = ExtensionManagementUtility::getExtensionKeyByPrefix('tx_'.$parts[1]); |
|
63 | + $extIcon = ExtensionManagementUtility::siteRelPath($extensionKey).'ext_icon.gif'; |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | // input for startPage |
90 | 90 | $fieldId = 'task_startPage'; |
91 | - $fieldCode = '<input name="tx_scheduler[startPage]" type="text" id="' . $fieldId . '" value="' . $task->startPage . '" class="form-control" />'; |
|
91 | + $fieldCode = '<input name="tx_scheduler[startPage]" type="text" id="'.$fieldId.'" value="'.$task->startPage.'" class="form-control" />'; |
|
92 | 92 | $additionalFields[$fieldId] = [ |
93 | 93 | 'code' => $fieldCode, |
94 | 94 | 'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_im.startPage' |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | '4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'), |
105 | 105 | '99' => $GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi'), |
106 | 106 | ]; |
107 | - $fieldCode = '<select name="tx_scheduler[depth]" id="' . $fieldId . '" class="form-control">'; |
|
107 | + $fieldCode = '<select name="tx_scheduler[depth]" id="'.$fieldId.'" class="form-control">'; |
|
108 | 108 | |
109 | 109 | foreach ($fieldValueArray as $key => $label) { |
110 | - $fieldCode .= "\t" . '<option value="' . $key . '"' . (($key == $task->depth) ? ' selected="selected"' : '') . '>' . $label . '</option>'; |
|
110 | + $fieldCode .= "\t".'<option value="'.$key.'"'.(($key == $task->depth) ? ' selected="selected"' : '').'>'.$label.'</option>'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | $fieldCode .= '</select>'; |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | // combobox for configuration records |
120 | 120 | $recordsArray = $this->getCrawlerConfigurationRecords(); |
121 | 121 | $fieldId = 'task_configuration'; |
122 | - $fieldCode = '<select name="tx_scheduler[configuration][]" multiple="multiple" id="' . $fieldId . '" class="form-control">'; |
|
123 | - $fieldCode .= "\t" . '<option value=""></option>'; |
|
122 | + $fieldCode = '<select name="tx_scheduler[configuration][]" multiple="multiple" id="'.$fieldId.'" class="form-control">'; |
|
123 | + $fieldCode .= "\t".'<option value=""></option>'; |
|
124 | 124 | for ($i = 0; $i < count($recordsArray); $i++) { |
125 | - $fieldCode .= "\t" . '<option ' . $this->getSelectedState($task->configuration, $recordsArray[$i]['name']) . 'value="' . $recordsArray[$i]['name'] . '">' . $recordsArray[$i]['name'] . '</option>'; |
|
125 | + $fieldCode .= "\t".'<option '.$this->getSelectedState($task->configuration, $recordsArray[$i]['name']).'value="'.$recordsArray[$i]['name'].'">'.$recordsArray[$i]['name'].'</option>'; |
|
126 | 126 | } |
127 | 127 | $fieldCode .= '</select>'; |
128 | 128 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
166 | 166 | '*', |
167 | 167 | 'tx_crawler_configuration', |
168 | - '1=1' . BackendUtility::deleteClause('tx_crawler_configuration') |
|
168 | + '1=1'.BackendUtility::deleteClause('tx_crawler_configuration') |
|
169 | 169 | ); |
170 | 170 | |
171 | 171 | while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function multiProcess($timeout) |
88 | 88 | { |
89 | 89 | if ($this->processLimit <= 1) { |
90 | - throw new RuntimeException('To run crawler in multi process mode you have to configure the processLimit > 1.' . PHP_EOL); |
|
90 | + throw new RuntimeException('To run crawler in multi process mode you have to configure the processLimit > 1.'.PHP_EOL); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $pendingItemsStart = $this->queueRepository->countAllPendingItems(); |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | $currentProcesses = $this->processRepository->countActive(); |
150 | 150 | $availableProcessesCount = $this->processLimit - $currentProcesses; |
151 | 151 | $requiredProcessesCount = ceil($this->queueRepository->countAllUnassignedPendingItems() / $this->countInARun); |
152 | - $startProcessCount = min([$availableProcessesCount,$requiredProcessesCount]); |
|
152 | + $startProcessCount = min([$availableProcessesCount, $requiredProcessesCount]); |
|
153 | 153 | if ($startProcessCount <= 0) { |
154 | 154 | return $ret; |
155 | 155 | } |
156 | 156 | if ($startProcessCount && $this->verbose) { |
157 | 157 | echo 'Start '.$startProcessCount.' new processes (Running:'.$currentProcesses.')'; |
158 | 158 | } |
159 | - for ($i = 0;$i < $startProcessCount;$i++) { |
|
159 | + for ($i = 0; $i < $startProcessCount; $i++) { |
|
160 | 160 | usleep(100); |
161 | 161 | if ($this->startProcess()) { |
162 | 162 | if ($this->verbose) { |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | { |
180 | 180 | $ttl = (time() + $this->timeToLive - 1); |
181 | 181 | $current = $this->processRepository->countNotTimeouted($ttl); |
182 | - $completePath = '(' .escapeshellcmd($this->getCrawlerCliPath()) . ' &) > /dev/null'; |
|
182 | + $completePath = '('.escapeshellcmd($this->getCrawlerCliPath()).' &) > /dev/null'; |
|
183 | 183 | if (system($completePath) === false) { |
184 | 184 | throw new Exception('could not start process!'); |
185 | 185 | } else { |
186 | - for ($i = 0;$i < 10;$i++) { |
|
186 | + for ($i = 0; $i < 10; $i++) { |
|
187 | 187 | if ($this->processRepository->countNotTimeouted($ttl) > $current) { |
188 | 188 | return true; |
189 | 189 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function getCrawlerCliPath() |
202 | 202 | { |
203 | - $phpPath = $this->crawlerObj->extensionSettings['phpPath'] . ' '; |
|
203 | + $phpPath = $this->crawlerObj->extensionSettings['phpPath'].' '; |
|
204 | 204 | $pathToTypo3 = rtrim(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT'), '/'); |
205 | 205 | $pathToTypo3 .= rtrim(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), '/'); |
206 | 206 | $cliPart = '/typo3/cli_dispatch.phpsh crawler'; |
@@ -64,7 +64,7 @@ |
||
64 | 64 | { |
65 | 65 | $db = $this->getDB(); |
66 | 66 | $where = 'process_id_completed=' . $db->fullQuoteStr($process->getProcess_id(), $this->tableName) . |
67 | - ' AND exec_time > 0 '; |
|
67 | + ' AND exec_time > 0 '; |
|
68 | 68 | $limit = 1; |
69 | 69 | $groupby = ''; |
70 | 70 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | protected function getFirstOrLastObjectByProcess($process, $orderby) |
64 | 64 | { |
65 | 65 | $db = $this->getDB(); |
66 | - $where = 'process_id_completed=' . $db->fullQuoteStr($process->getProcess_id(), $this->tableName) . |
|
66 | + $where = 'process_id_completed='.$db->fullQuoteStr($process->getProcess_id(), $this->tableName). |
|
67 | 67 | ' AND exec_time > 0 '; |
68 | 68 | $limit = 1; |
69 | 69 | $groupby = ''; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function countExecutedItemsByProcess($process) |
90 | 90 | { |
91 | - return $this->countItemsByWhereClause('exec_time > 0 AND process_id_completed = ' . $this->getDB()->fullQuoteStr( |
|
91 | + return $this->countItemsByWhereClause('exec_time > 0 AND process_id_completed = '.$this->getDB()->fullQuoteStr( |
|
92 | 92 | $process->getProcess_id(), |
93 | 93 | $this->tableName |
94 | 94 | )); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function countNonExecutedItemsByProcess($process) |
105 | 105 | { |
106 | - return $this->countItemsByWhereClause('exec_time = 0 AND process_id = ' . $this->getDB()->fullQuoteStr( |
|
106 | + return $this->countItemsByWhereClause('exec_time = 0 AND process_id = '.$this->getDB()->fullQuoteStr( |
|
107 | 107 | $process->getProcess_id(), |
108 | 108 | $this->tableName |
109 | 109 | )); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function countAllPendingItems() |
121 | 121 | { |
122 | - return $this->countItemsByWhereClause('exec_time = 0 AND scheduled < ' . time()); |
|
122 | + return $this->countItemsByWhereClause('exec_time = 0 AND scheduled < '.time()); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function countAllAssignedPendingItems() |
134 | 134 | { |
135 | - return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < " . time() . " AND process_id != ''"); |
|
135 | + return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < ".time()." AND process_id != ''"); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function countAllUnassignedPendingItems() |
147 | 147 | { |
148 | - return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < " . time() . " AND process_id = ''"); |
|
148 | + return $this->countItemsByWhereClause("exec_time = 0 AND scheduled < ".time()." AND process_id = ''"); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $res = $db->exec_SELECTquery( |
176 | 176 | "configuration, count(*) as unprocessed, sum(process_id != '') as assignedButUnprocessed", |
177 | 177 | $this->tableName, |
178 | - 'exec_time = 0 AND scheduled < ' . time(), |
|
178 | + 'exec_time = 0 AND scheduled < '.time(), |
|
179 | 179 | 'configuration' |
180 | 180 | ); |
181 | 181 | $rows = []; |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $res = $db->exec_SELECTquery( |
200 | 200 | 'set_id', |
201 | 201 | $this->tableName, |
202 | - 'exec_time = 0 AND scheduled < ' . time(), |
|
202 | + 'exec_time = 0 AND scheduled < '.time(), |
|
203 | 203 | 'set_id' |
204 | 204 | ); |
205 | 205 | $setIds = []; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $res = $db->exec_SELECTquery( |
226 | 226 | 'configuration, count(*) as c', |
227 | 227 | $this->tableName, |
228 | - 'set_id in (' . implode(',', $setIds) . ') AND scheduled < ' . time(), |
|
228 | + 'set_id in ('.implode(',', $setIds).') AND scheduled < '.time(), |
|
229 | 229 | 'configuration' |
230 | 230 | ); |
231 | 231 | while ($row = $db->sql_fetch_assoc($res)) { |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $res = $db->exec_SELECTquery( |
306 | 306 | 'process_id_completed, min(exec_time) as start, max(exec_time) as end, count(*) as urlcount', |
307 | 307 | $this->tableName, |
308 | - 'exec_time != 0 and exec_time >= ' . intval($start) . ' and exec_time <= ' . intval($end), |
|
308 | + 'exec_time != 0 and exec_time >= '.intval($start).' and exec_time <= '.intval($end), |
|
309 | 309 | 'process_id_completed' |
310 | 310 | ); |
311 | 311 |