@@ -318,7 +318,7 @@ |
||
| 318 | 318 | return \AOE\Crawler\Utility\ButtonUtility::getLinkButton( |
| 319 | 319 | 'actions-refresh', |
| 320 | 320 | $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh'), |
| 321 | - 'window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess&id=' . $this->pageId . '\';' |
|
| 321 | + 'window.location=\''.\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info').'&SET[crawlaction]=multiprocess&id='.$this->pageId.'\';' |
|
| 322 | 322 | ); |
| 323 | 323 | } |
| 324 | 324 | |
@@ -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 | ]; |
@@ -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)) { |
@@ -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 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | $this->db = $GLOBALS['TYPO3_DB']; |
| 206 | 206 | $this->backendUser = $GLOBALS['BE_USER']; |
| 207 | - $this->processFilename = PATH_site . 'typo3temp/tx_crawler.proc'; |
|
| 207 | + $this->processFilename = PATH_site.'typo3temp/tx_crawler.proc'; |
|
| 208 | 208 | |
| 209 | 209 | $settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['crawler']); |
| 210 | 210 | $settings = is_array($settings) ? $settings : []; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['excludeDoktype'] as $key => $doktypeList) { |
| 263 | 263 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($doktypeList, $pageRow['doktype'])) { |
| 264 | 264 | $skipPage = true; |
| 265 | - $skipMessage = 'Doktype was excluded by "' . $key . '"'; |
|
| 265 | + $skipMessage = 'Doktype was excluded by "'.$key.'"'; |
|
| 266 | 266 | break; |
| 267 | 267 | } |
| 268 | 268 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | if (is_string($veto)) { |
| 284 | 284 | $skipMessage = $veto; |
| 285 | 285 | } else { |
| 286 | - $skipMessage = 'Veto from hook "' . htmlspecialchars($key) . '"'; |
|
| 286 | + $skipMessage = 'Veto from hook "'.htmlspecialchars($key).'"'; |
|
| 287 | 287 | } |
| 288 | 288 | // no need to execute other hooks if a previous one return a veto |
| 289 | 289 | break; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | protected function noUnprocessedQueueEntriesForPageWithConfigurationHashExist($uid, $configurationHash) |
| 333 | 333 | { |
| 334 | 334 | $configurationHash = $this->db->fullQuoteStr($configurationHash, 'tx_crawler_queue'); |
| 335 | - $res = $this->db->exec_SELECTquery('count(*) as anz', 'tx_crawler_queue', "page_id=" . intval($uid) . " AND configuration_hash=" . $configurationHash . " AND exec_time=0"); |
|
| 335 | + $res = $this->db->exec_SELECTquery('count(*) as anz', 'tx_crawler_queue', "page_id=".intval($uid)." AND configuration_hash=".$configurationHash." AND exec_time=0"); |
|
| 336 | 336 | $row = $this->db->sql_fetch_assoc($res); |
| 337 | 337 | |
| 338 | 338 | return ($row['anz'] == 0); |
@@ -408,14 +408,14 @@ discard block |
||
| 408 | 408 | if ($vv['subCfg']['cHash']) { |
| 409 | 409 | /* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */ |
| 410 | 410 | $cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\Page\CacheHashCalculator'); |
| 411 | - $urlQuery .= '&cHash=' . $cacheHash->generateForParameters($urlQuery); |
|
| 411 | + $urlQuery .= '&cHash='.$cacheHash->generateForParameters($urlQuery); |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | // Create key by which to determine unique-ness: |
| 415 | - $uKey = $urlQuery . '|' . $vv['subCfg']['userGroups'] . '|' . $vv['subCfg']['baseUrl'] . '|' . $vv['subCfg']['procInstrFilter']; |
|
| 415 | + $uKey = $urlQuery.'|'.$vv['subCfg']['userGroups'].'|'.$vv['subCfg']['baseUrl'].'|'.$vv['subCfg']['procInstrFilter']; |
|
| 416 | 416 | |
| 417 | 417 | // realurl support (thanks to Ingo Renner) |
| 418 | - $urlQuery = 'index.php' . $urlQuery; |
|
| 418 | + $urlQuery = 'index.php'.$urlQuery; |
|
| 419 | 419 | if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl') && $vv['subCfg']['realurl']) { |
| 420 | 420 | $params = [ |
| 421 | 421 | 'LD' => [ |
@@ -434,12 +434,12 @@ discard block |
||
| 434 | 434 | if (isset($duplicateTrack[$uKey])) { |
| 435 | 435 | |
| 436 | 436 | //if the url key is registered just display it and do not resubmit is |
| 437 | - $urlList = '<em><span class="typo3-dimmed">' . htmlspecialchars($urlQuery) . '</span></em><br/>'; |
|
| 437 | + $urlList = '<em><span class="typo3-dimmed">'.htmlspecialchars($urlQuery).'</span></em><br/>'; |
|
| 438 | 438 | } else { |
| 439 | - $urlList = '[' . date('d.m.y H:i', $schTime) . '] ' . htmlspecialchars($urlQuery); |
|
| 440 | - $this->urlList[] = '[' . date('d.m.y H:i', $schTime) . '] ' . $urlQuery; |
|
| 439 | + $urlList = '['.date('d.m.y H:i', $schTime).'] '.htmlspecialchars($urlQuery); |
|
| 440 | + $this->urlList[] = '['.date('d.m.y H:i', $schTime).'] '.$urlQuery; |
|
| 441 | 441 | |
| 442 | - $theUrl = ($vv['subCfg']['baseUrl'] ? $vv['subCfg']['baseUrl'] : \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')) . $urlQuery; |
|
| 442 | + $theUrl = ($vv['subCfg']['baseUrl'] ? $vv['subCfg']['baseUrl'] : \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')).$urlQuery; |
|
| 443 | 443 | |
| 444 | 444 | // Submit for crawling! |
| 445 | 445 | if ($submitCrawlUrls) { |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | if (!is_array($values)) { |
| 542 | 542 | |
| 543 | 543 | // Sub configuration for a single configuration string: |
| 544 | - $subCfg = (array)$crawlerCfg['paramSets.'][$key . '.']; |
|
| 544 | + $subCfg = (array) $crawlerCfg['paramSets.'][$key.'.']; |
|
| 545 | 545 | $subCfg['key'] = $key; |
| 546 | 546 | |
| 547 | 547 | if (strcmp($subCfg['procInstrFilter'], '')) { |
@@ -566,9 +566,9 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | // recognize MP value |
| 568 | 568 | if (!$this->MP) { |
| 569 | - $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id=' . $id]); |
|
| 569 | + $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id='.$id]); |
|
| 570 | 570 | } else { |
| 571 | - $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id=' . $id . '&MP=' . $this->MP]); |
|
| 571 | + $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id='.$id.'&MP='.$this->MP]); |
|
| 572 | 572 | } |
| 573 | 573 | } |
| 574 | 574 | } |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | 'tx_crawler_configuration', |
| 589 | 589 | 'pid', |
| 590 | 590 | intval($page['uid']), |
| 591 | - \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration') |
|
| 591 | + \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration').\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration') |
|
| 592 | 592 | ); |
| 593 | 593 | |
| 594 | 594 | if (is_array($configurationRecordsForCurrentPage)) { |
@@ -634,8 +634,8 @@ discard block |
||
| 634 | 634 | $res[$key]['subCfg'] = $subCfg; |
| 635 | 635 | $res[$key]['paramParsed'] = $this->parseParams($configurationRecord['configuration']); |
| 636 | 636 | $res[$key]['paramExpanded'] = $this->expandParameters($res[$key]['paramParsed'], $id); |
| 637 | - $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id=' . $id]); |
|
| 638 | - $res[$key]['origin'] = 'tx_crawler_configuration_' . $configurationRecord['uid']; |
|
| 637 | + $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id='.$id]); |
|
| 638 | + $res[$key]['origin'] = 'tx_crawler_configuration_'.$configurationRecord['uid']; |
|
| 639 | 639 | } |
| 640 | 640 | } |
| 641 | 641 | } |
@@ -673,13 +673,13 @@ discard block |
||
| 673 | 673 | $res = $this->db->exec_SELECTquery( |
| 674 | 674 | '*', |
| 675 | 675 | 'sys_domain', |
| 676 | - 'uid = ' . $sysDomainUid . |
|
| 677 | - \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_domain') . |
|
| 676 | + 'uid = '.$sysDomainUid. |
|
| 677 | + \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_domain'). |
|
| 678 | 678 | \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_domain') |
| 679 | 679 | ); |
| 680 | 680 | $row = $this->db->sql_fetch_assoc($res); |
| 681 | 681 | if ($row['domainName'] != '') { |
| 682 | - return $urlScheme . '://' . $row['domainName']; |
|
| 682 | + return $urlScheme.'://'.$row['domainName']; |
|
| 683 | 683 | } |
| 684 | 684 | } |
| 685 | 685 | return $baseUrl; |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | /* @var \TYPO3\CMS\Backend\Tree\View\PageTreeView */ |
| 710 | 710 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 711 | 711 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| 712 | - $tree->init('AND ' . $perms_clause); |
|
| 712 | + $tree->init('AND '.$perms_clause); |
|
| 713 | 713 | $tree->getTree($rootid, $depth, ''); |
| 714 | 714 | foreach ($tree->tree as $node) { |
| 715 | 715 | $pids[] = $node['row']['uid']; |
@@ -718,10 +718,10 @@ discard block |
||
| 718 | 718 | $res = $this->db->exec_SELECTquery( |
| 719 | 719 | '*', |
| 720 | 720 | 'tx_crawler_configuration', |
| 721 | - 'pid IN (' . implode(',', $pids) . ') ' . |
|
| 722 | - \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration') . |
|
| 723 | - \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration') . ' ' . |
|
| 724 | - \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('tx_crawler_configuration') . ' ' |
|
| 721 | + 'pid IN ('.implode(',', $pids).') '. |
|
| 722 | + \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration'). |
|
| 723 | + \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration').' '. |
|
| 724 | + \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('tx_crawler_configuration').' ' |
|
| 725 | 725 | ); |
| 726 | 726 | |
| 727 | 727 | while ($row = $this->db->sql_fetch_assoc($res)) { |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | |
| 821 | 821 | // Traverse range, add values: |
| 822 | 822 | $runAwayBrake = 1000; // Limit to size of range! |
| 823 | - for ($a = $reg[1]; $a <= $reg[2];$a++) { |
|
| 823 | + for ($a = $reg[1]; $a <= $reg[2]; $a++) { |
|
| 824 | 824 | $paramArray[$p][] = $a; |
| 825 | 825 | $runAwayBrake--; |
| 826 | 826 | if ($runAwayBrake <= 0) { |
@@ -850,16 +850,16 @@ discard block |
||
| 850 | 850 | $transOrigPointerField = $TCA[$subpartParams['_TABLE']]['ctrl']['transOrigPointerField']; |
| 851 | 851 | |
| 852 | 852 | if ($subpartParams['_ENABLELANG'] && $transOrigPointerField) { |
| 853 | - $andWhereLanguage = ' AND ' . $this->db->quoteStr($transOrigPointerField, $subpartParams['_TABLE']) . ' <= 0 '; |
|
| 853 | + $andWhereLanguage = ' AND '.$this->db->quoteStr($transOrigPointerField, $subpartParams['_TABLE']).' <= 0 '; |
|
| 854 | 854 | } |
| 855 | 855 | |
| 856 | - $where = $this->db->quoteStr($pidField, $subpartParams['_TABLE']) . '=' . intval($lookUpPid) . ' ' . |
|
| 857 | - $andWhereLanguage . $where; |
|
| 856 | + $where = $this->db->quoteStr($pidField, $subpartParams['_TABLE']).'='.intval($lookUpPid).' '. |
|
| 857 | + $andWhereLanguage.$where; |
|
| 858 | 858 | |
| 859 | 859 | $rows = $this->db->exec_SELECTgetRows( |
| 860 | 860 | $fieldName, |
| 861 | - $subpartParams['_TABLE'] . $addTable, |
|
| 862 | - $where . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($subpartParams['_TABLE']), |
|
| 861 | + $subpartParams['_TABLE'].$addTable, |
|
| 862 | + $where.\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($subpartParams['_TABLE']), |
|
| 863 | 863 | '', |
| 864 | 864 | '', |
| 865 | 865 | '', |
@@ -921,7 +921,7 @@ discard block |
||
| 921 | 921 | $newUrls = []; |
| 922 | 922 | foreach ($urls as $url) { |
| 923 | 923 | foreach ($valueSet as $val) { |
| 924 | - $newUrls[] = $url . (strcmp($val, '') ? '&' . rawurlencode($varName) . '=' . rawurlencode($val) : ''); |
|
| 924 | + $newUrls[] = $url.(strcmp($val, '') ? '&'.rawurlencode($varName).'='.rawurlencode($val) : ''); |
|
| 925 | 925 | |
| 926 | 926 | if (count($newUrls) > \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['maxCompileUrls'], 1, 1000000000, 10000)) { |
| 927 | 927 | break; |
@@ -968,13 +968,13 @@ discard block |
||
| 968 | 968 | |
| 969 | 969 | // FIXME: Write unit test that ensures that the right records are deleted. |
| 970 | 970 | if ($doFlush) { |
| 971 | - $this->flushQueue(($doFullFlush ? '1=1' : ('page_id=' . intval($id))) . $addWhere); |
|
| 971 | + $this->flushQueue(($doFullFlush ? '1=1' : ('page_id='.intval($id))).$addWhere); |
|
| 972 | 972 | return []; |
| 973 | 973 | } else { |
| 974 | 974 | return $this->db->exec_SELECTgetRows( |
| 975 | 975 | '*', |
| 976 | 976 | 'tx_crawler_queue', |
| 977 | - 'page_id=' . intval($id) . $addWhere, |
|
| 977 | + 'page_id='.intval($id).$addWhere, |
|
| 978 | 978 | '', |
| 979 | 979 | 'scheduled DESC', |
| 980 | 980 | (intval($itemsPerPage) > 0 ? intval($itemsPerPage) : '') |
@@ -1007,13 +1007,13 @@ discard block |
||
| 1007 | 1007 | } |
| 1008 | 1008 | // FIXME: Write unit test that ensures that the right records are deleted. |
| 1009 | 1009 | if ($doFlush) { |
| 1010 | - $this->flushQueue($doFullFlush ? '' : ('set_id=' . intval($set_id) . $addWhere)); |
|
| 1010 | + $this->flushQueue($doFullFlush ? '' : ('set_id='.intval($set_id).$addWhere)); |
|
| 1011 | 1011 | return []; |
| 1012 | 1012 | } else { |
| 1013 | 1013 | return $this->db->exec_SELECTgetRows( |
| 1014 | 1014 | '*', |
| 1015 | 1015 | 'tx_crawler_queue', |
| 1016 | - 'set_id=' . intval($set_id) . $addWhere, |
|
| 1016 | + 'set_id='.intval($set_id).$addWhere, |
|
| 1017 | 1017 | '', |
| 1018 | 1018 | 'scheduled DESC', |
| 1019 | 1019 | (intval($itemsPerPage) > 0 ? intval($itemsPerPage) : '') |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | if (tx_crawler_domain_events_dispatcher::getInstance()->hasObserver('queueEntryFlush')) { |
| 1035 | 1035 | $groups = $this->db->exec_SELECTgetRows('DISTINCT set_id', 'tx_crawler_queue', $realWhere); |
| 1036 | 1036 | foreach ($groups as $group) { |
| 1037 | - tx_crawler_domain_events_dispatcher::getInstance()->post('queueEntryFlush', $group['set_id'], $this->db->exec_SELECTgetRows('uid, set_id', 'tx_crawler_queue', $realWhere . ' AND set_id="' . $group['set_id'] . '"')); |
|
| 1037 | + tx_crawler_domain_events_dispatcher::getInstance()->post('queueEntryFlush', $group['set_id'], $this->db->exec_SELECTgetRows('uid, set_id', 'tx_crawler_queue', $realWhere.' AND set_id="'.$group['set_id'].'"')); |
|
| 1038 | 1038 | } |
| 1039 | 1039 | } |
| 1040 | 1040 | |
@@ -1176,24 +1176,24 @@ discard block |
||
| 1176 | 1176 | if ($this->extensionSettings['enableTimeslot']) { |
| 1177 | 1177 | $timeBegin = $currentTime - 100; |
| 1178 | 1178 | $timeEnd = $currentTime + 100; |
| 1179 | - $where = ' ((scheduled BETWEEN ' . $timeBegin . ' AND ' . $timeEnd . ' ) OR scheduled <= ' . $currentTime . ') '; |
|
| 1179 | + $where = ' ((scheduled BETWEEN '.$timeBegin.' AND '.$timeEnd.' ) OR scheduled <= '.$currentTime.') '; |
|
| 1180 | 1180 | } else { |
| 1181 | - $where = 'scheduled <= ' . $currentTime; |
|
| 1181 | + $where = 'scheduled <= '.$currentTime; |
|
| 1182 | 1182 | } |
| 1183 | 1183 | } elseif ($tstamp > $currentTime) { |
| 1184 | 1184 | //entry with a timestamp in the future need to have the same schedule time |
| 1185 | - $where = 'scheduled = ' . $tstamp ; |
|
| 1185 | + $where = 'scheduled = '.$tstamp; |
|
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | if (!empty($where)) { |
| 1189 | 1189 | $result = $this->db->exec_SELECTgetRows( |
| 1190 | 1190 | 'qid', |
| 1191 | 1191 | 'tx_crawler_queue', |
| 1192 | - $where . |
|
| 1193 | - ' AND NOT exec_time' . |
|
| 1194 | - ' AND NOT process_id ' . |
|
| 1195 | - ' AND page_id=' . intval($fieldArray['page_id']) . |
|
| 1196 | - ' AND parameters_hash = ' . $this->db->fullQuoteStr($fieldArray['parameters_hash'], 'tx_crawler_queue') |
|
| 1192 | + $where. |
|
| 1193 | + ' AND NOT exec_time'. |
|
| 1194 | + ' AND NOT process_id '. |
|
| 1195 | + ' AND page_id='.intval($fieldArray['page_id']). |
|
| 1196 | + ' AND parameters_hash = '.$this->db->fullQuoteStr($fieldArray['parameters_hash'], 'tx_crawler_queue') |
|
| 1197 | 1197 | ); |
| 1198 | 1198 | |
| 1199 | 1199 | if (is_array($result)) { |
@@ -1233,13 +1233,13 @@ discard block |
||
| 1233 | 1233 | { |
| 1234 | 1234 | $ret = 0; |
| 1235 | 1235 | if ($this->debugMode) { |
| 1236 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl start ' . microtime(true), __FUNCTION__); |
|
| 1236 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl start '.microtime(true), __FUNCTION__); |
|
| 1237 | 1237 | } |
| 1238 | 1238 | // Get entry: |
| 1239 | 1239 | list($queueRec) = $this->db->exec_SELECTgetRows( |
| 1240 | 1240 | '*', |
| 1241 | 1241 | 'tx_crawler_queue', |
| 1242 | - 'qid=' . intval($queueId) . ($force ? '' : ' AND exec_time=0 AND process_scheduled > 0') |
|
| 1242 | + 'qid='.intval($queueId).($force ? '' : ' AND exec_time=0 AND process_scheduled > 0') |
|
| 1243 | 1243 | ); |
| 1244 | 1244 | |
| 1245 | 1245 | if (!is_array($queueRec)) { |
@@ -1248,10 +1248,10 @@ discard block |
||
| 1248 | 1248 | |
| 1249 | 1249 | $parameters = unserialize($queueRec['parameters']); |
| 1250 | 1250 | if ($parameters['rootTemplatePid']) { |
| 1251 | - $this->initTSFE((int)$parameters['rootTemplatePid']); |
|
| 1251 | + $this->initTSFE((int) $parameters['rootTemplatePid']); |
|
| 1252 | 1252 | } else { |
| 1253 | 1253 | \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog( |
| 1254 | - 'Page with (' . $queueRec['page_id'] . ') could not be crawled, please check your crawler configuration. Perhaps no Root Template Pid is set', |
|
| 1254 | + 'Page with ('.$queueRec['page_id'].') could not be crawled, please check your crawler configuration. Perhaps no Root Template Pid is set', |
|
| 1255 | 1255 | 'crawler', |
| 1256 | 1256 | \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING |
| 1257 | 1257 | ); |
@@ -1270,7 +1270,7 @@ discard block |
||
| 1270 | 1270 | //if mulitprocessing is used we need to store the id of the process which has handled this entry |
| 1271 | 1271 | $field_array['process_id_completed'] = $this->processID; |
| 1272 | 1272 | } |
| 1273 | - $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid=' . intval($queueId), $field_array); |
|
| 1273 | + $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid='.intval($queueId), $field_array); |
|
| 1274 | 1274 | |
| 1275 | 1275 | $result = $this->readUrl_exec($queueRec); |
| 1276 | 1276 | $resultData = unserialize($result['content']); |
@@ -1301,10 +1301,10 @@ discard block |
||
| 1301 | 1301 | [$queueId, &$field_array] |
| 1302 | 1302 | ); |
| 1303 | 1303 | |
| 1304 | - $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid=' . intval($queueId), $field_array); |
|
| 1304 | + $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid='.intval($queueId), $field_array); |
|
| 1305 | 1305 | |
| 1306 | 1306 | if ($this->debugMode) { |
| 1307 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl stop ' . microtime(true), __FUNCTION__); |
|
| 1307 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl stop '.microtime(true), __FUNCTION__); |
|
| 1308 | 1308 | } |
| 1309 | 1309 | |
| 1310 | 1310 | return $ret; |
@@ -1335,7 +1335,7 @@ discard block |
||
| 1335 | 1335 | [$queueId, &$field_array] |
| 1336 | 1336 | ); |
| 1337 | 1337 | |
| 1338 | - $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid=' . intval($queueId), $field_array); |
|
| 1338 | + $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid='.intval($queueId), $field_array); |
|
| 1339 | 1339 | |
| 1340 | 1340 | return $result; |
| 1341 | 1341 | } |
@@ -1359,12 +1359,12 @@ discard block |
||
| 1359 | 1359 | unset($parameters['_CALLBACKOBJ']); |
| 1360 | 1360 | $result = ['content' => serialize($callBackObj->crawler_execute($parameters, $this))]; |
| 1361 | 1361 | } else { |
| 1362 | - $result = ['content' => 'No object: ' . $objRef]; |
|
| 1362 | + $result = ['content' => 'No object: '.$objRef]; |
|
| 1363 | 1363 | } |
| 1364 | 1364 | } else { // Regular FE request: |
| 1365 | 1365 | |
| 1366 | 1366 | // Prepare: |
| 1367 | - $crawlerId = $queueRec['qid'] . ':' . md5($queueRec['qid'] . '|' . $queueRec['set_id'] . '|' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']); |
|
| 1367 | + $crawlerId = $queueRec['qid'].':'.md5($queueRec['qid'].'|'.$queueRec['set_id'].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']); |
|
| 1368 | 1368 | |
| 1369 | 1369 | // Get result: |
| 1370 | 1370 | $result = $this->requestUrl($parameters['url'], $crawlerId); |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | return false; |
| 1402 | 1402 | } |
| 1403 | 1403 | |
| 1404 | - if (!in_array($url['scheme'], ['','http','https'])) { |
|
| 1404 | + if (!in_array($url['scheme'], ['', 'http', 'https'])) { |
|
| 1405 | 1405 | if (TYPO3_DLOG) { |
| 1406 | 1406 | \TYPO3\CMS\Core\Utility\GeneralUtility::devLog(sprintf('Scheme does not match for url "%s"', $url), 'crawler', 4, ['crawlerId' => $crawlerId]); |
| 1407 | 1407 | } |
@@ -1421,14 +1421,14 @@ discard block |
||
| 1421 | 1421 | |
| 1422 | 1422 | if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlUse'] && $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']) { |
| 1423 | 1423 | $rurl = parse_url($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']); |
| 1424 | - $url['path'] = $url['scheme'] . '://' . $url['host'] . ($url['port'] > 0 ? ':' . $url['port'] : '') . $url['path']; |
|
| 1424 | + $url['path'] = $url['scheme'].'://'.$url['host'].($url['port'] > 0 ? ':'.$url['port'] : '').$url['path']; |
|
| 1425 | 1425 | $reqHeaders = $this->buildRequestHeaderArray($url, $crawlerId); |
| 1426 | 1426 | } |
| 1427 | 1427 | |
| 1428 | 1428 | $host = $rurl['host']; |
| 1429 | 1429 | |
| 1430 | 1430 | if ($url['scheme'] == 'https') { |
| 1431 | - $host = 'ssl://' . $host; |
|
| 1431 | + $host = 'ssl://'.$host; |
|
| 1432 | 1432 | $port = ($rurl['port'] > 0) ? $rurl['port'] : 443; |
| 1433 | 1433 | } else { |
| 1434 | 1434 | $port = ($rurl['port'] > 0) ? $rurl['port'] : 80; |
@@ -1444,7 +1444,7 @@ discard block |
||
| 1444 | 1444 | return false; |
| 1445 | 1445 | } else { |
| 1446 | 1446 | // Request message: |
| 1447 | - $msg = implode("\r\n", $reqHeaders) . "\r\n\r\n"; |
|
| 1447 | + $msg = implode("\r\n", $reqHeaders)."\r\n\r\n"; |
|
| 1448 | 1448 | fputs($fp, $msg); |
| 1449 | 1449 | |
| 1450 | 1450 | // Read response: |
@@ -1452,13 +1452,13 @@ discard block |
||
| 1452 | 1452 | fclose($fp); |
| 1453 | 1453 | |
| 1454 | 1454 | $time = microtime(true) - $startTime; |
| 1455 | - $this->log($originalUrl . ' ' . $time); |
|
| 1455 | + $this->log($originalUrl.' '.$time); |
|
| 1456 | 1456 | |
| 1457 | 1457 | // Implode content and headers: |
| 1458 | 1458 | $result = [ |
| 1459 | 1459 | 'request' => $msg, |
| 1460 | 1460 | 'headers' => implode('', $d['headers']), |
| 1461 | - 'content' => implode('', (array)$d['content']) |
|
| 1461 | + 'content' => implode('', (array) $d['content']) |
|
| 1462 | 1462 | ]; |
| 1463 | 1463 | |
| 1464 | 1464 | if (($this->extensionSettings['follow30x']) && ($newUrl = $this->getRequestUrlFrom302Header($d['headers'], $url['user'], $url['pass']))) { |
@@ -1503,8 +1503,8 @@ discard block |
||
| 1503 | 1503 | |
| 1504 | 1504 | // Base path must be '/<pathSegements>/': |
| 1505 | 1505 | if ($frontendBasePath != '/') { |
| 1506 | - $frontendBasePath = '/' . ltrim($frontendBasePath, '/'); |
|
| 1507 | - $frontendBasePath = rtrim($frontendBasePath, '/') . '/'; |
|
| 1506 | + $frontendBasePath = '/'.ltrim($frontendBasePath, '/'); |
|
| 1507 | + $frontendBasePath = rtrim($frontendBasePath, '/').'/'; |
|
| 1508 | 1508 | } |
| 1509 | 1509 | |
| 1510 | 1510 | return $frontendBasePath; |
@@ -1560,7 +1560,7 @@ discard block |
||
| 1560 | 1560 | protected function log($message) |
| 1561 | 1561 | { |
| 1562 | 1562 | if (!empty($this->extensionSettings['logFileName'])) { |
| 1563 | - @file_put_contents($this->extensionSettings['logFileName'], date('Ymd His') . ' ' . $message . PHP_EOL, FILE_APPEND); |
|
| 1563 | + @file_put_contents($this->extensionSettings['logFileName'], date('Ymd His').' '.$message.PHP_EOL, FILE_APPEND); |
|
| 1564 | 1564 | } |
| 1565 | 1565 | } |
| 1566 | 1566 | |
@@ -1575,16 +1575,16 @@ discard block |
||
| 1575 | 1575 | protected function buildRequestHeaderArray(array $url, $crawlerId) |
| 1576 | 1576 | { |
| 1577 | 1577 | $reqHeaders = []; |
| 1578 | - $reqHeaders[] = 'GET ' . $url['path'] . ($url['query'] ? '?' . $url['query'] : '') . ' HTTP/1.0'; |
|
| 1579 | - $reqHeaders[] = 'Host: ' . $url['host']; |
|
| 1578 | + $reqHeaders[] = 'GET '.$url['path'].($url['query'] ? '?'.$url['query'] : '').' HTTP/1.0'; |
|
| 1579 | + $reqHeaders[] = 'Host: '.$url['host']; |
|
| 1580 | 1580 | if (stristr($url['query'], 'ADMCMD_previewWS')) { |
| 1581 | 1581 | $reqHeaders[] = 'Cookie: $Version="1"; be_typo_user="1"; $Path=/'; |
| 1582 | 1582 | } |
| 1583 | 1583 | $reqHeaders[] = 'Connection: close'; |
| 1584 | 1584 | if ($url['user'] != '') { |
| 1585 | - $reqHeaders[] = 'Authorization: Basic ' . base64_encode($url['user'] . ':' . $url['pass']); |
|
| 1585 | + $reqHeaders[] = 'Authorization: Basic '.base64_encode($url['user'].':'.$url['pass']); |
|
| 1586 | 1586 | } |
| 1587 | - $reqHeaders[] = 'X-T3crawler: ' . $crawlerId; |
|
| 1587 | + $reqHeaders[] = 'X-T3crawler: '.$crawlerId; |
|
| 1588 | 1588 | $reqHeaders[] = 'User-Agent: TYPO3 crawler'; |
| 1589 | 1589 | return $reqHeaders; |
| 1590 | 1590 | } |
@@ -1621,9 +1621,9 @@ discard block |
||
| 1621 | 1621 | if (!($tmp = parse_url($header['Location']))) { |
| 1622 | 1622 | return false; |
| 1623 | 1623 | } |
| 1624 | - $newUrl = $tmp['scheme'] . '://' . $user . ':' . $pass . '@' . $tmp['host'] . $tmp['path']; |
|
| 1624 | + $newUrl = $tmp['scheme'].'://'.$user.':'.$pass.'@'.$tmp['host'].$tmp['path']; |
|
| 1625 | 1625 | if ($tmp['query'] != '') { |
| 1626 | - $newUrl .= '?' . $tmp['query']; |
|
| 1626 | + $newUrl .= '?'.$tmp['query']; |
|
| 1627 | 1627 | } |
| 1628 | 1628 | } else { |
| 1629 | 1629 | $newUrl = $header['Location']; |
@@ -1651,10 +1651,10 @@ discard block |
||
| 1651 | 1651 | // Authenticate crawler request: |
| 1652 | 1652 | if (isset($_SERVER['HTTP_X_T3CRAWLER'])) { |
| 1653 | 1653 | list($queueId, $hash) = explode(':', $_SERVER['HTTP_X_T3CRAWLER']); |
| 1654 | - list($queueRec) = $this->db->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid=' . intval($queueId)); |
|
| 1654 | + list($queueRec) = $this->db->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid='.intval($queueId)); |
|
| 1655 | 1655 | |
| 1656 | 1656 | // If a crawler record was found and hash was matching, set it up: |
| 1657 | - if (is_array($queueRec) && $hash === md5($queueRec['qid'] . '|' . $queueRec['set_id'] . '|' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) { |
|
| 1657 | + if (is_array($queueRec) && $hash === md5($queueRec['qid'].'|'.$queueRec['set_id'].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) { |
|
| 1658 | 1658 | $params['pObj']->applicationData['tx_crawler']['running'] = true; |
| 1659 | 1659 | $params['pObj']->applicationData['tx_crawler']['parameters'] = unserialize($queueRec['parameters']); |
| 1660 | 1660 | $params['pObj']->applicationData['tx_crawler']['log'] = []; |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | /* @var $tree \TYPO3\CMS\Backend\Tree\View\PageTreeView */ |
| 1712 | 1712 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 1713 | 1713 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| 1714 | - $tree->init('AND ' . $perms_clause); |
|
| 1714 | + $tree->init('AND '.$perms_clause); |
|
| 1715 | 1715 | |
| 1716 | 1716 | $pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($id, $perms_clause); |
| 1717 | 1717 | |
@@ -1734,19 +1734,19 @@ discard block |
||
| 1734 | 1734 | |
| 1735 | 1735 | // recognize mount points |
| 1736 | 1736 | if ($data['row']['doktype'] == 7) { |
| 1737 | - $mountpage = $this->db->exec_SELECTgetRows('*', 'pages', 'uid = ' . $data['row']['uid']); |
|
| 1737 | + $mountpage = $this->db->exec_SELECTgetRows('*', 'pages', 'uid = '.$data['row']['uid']); |
|
| 1738 | 1738 | |
| 1739 | 1739 | // fetch mounted pages |
| 1740 | - $this->MP = $mountpage[0]['mount_pid'] . '-' . $data['row']['uid']; |
|
| 1740 | + $this->MP = $mountpage[0]['mount_pid'].'-'.$data['row']['uid']; |
|
| 1741 | 1741 | |
| 1742 | 1742 | $mountTree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 1743 | - $mountTree->init('AND ' . $perms_clause); |
|
| 1743 | + $mountTree->init('AND '.$perms_clause); |
|
| 1744 | 1744 | $mountTree->getTree($mountpage[0]['mount_pid'], $depth, ''); |
| 1745 | 1745 | |
| 1746 | 1746 | foreach ($mountTree->tree as $mountData) { |
| 1747 | 1747 | $code .= $this->drawURLs_addRowsForPage( |
| 1748 | 1748 | $mountData['row'], |
| 1749 | - $mountData['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $mountData['row'], true) |
|
| 1749 | + $mountData['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $mountData['row'], true) |
|
| 1750 | 1750 | ); |
| 1751 | 1751 | } |
| 1752 | 1752 | |
@@ -1761,7 +1761,7 @@ discard block |
||
| 1761 | 1761 | |
| 1762 | 1762 | $code .= $this->drawURLs_addRowsForPage( |
| 1763 | 1763 | $data['row'], |
| 1764 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true) |
|
| 1764 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true) |
|
| 1765 | 1765 | ); |
| 1766 | 1766 | } |
| 1767 | 1767 | |
@@ -1786,7 +1786,7 @@ discard block |
||
| 1786 | 1786 | if (!empty($excludeString)) { |
| 1787 | 1787 | /* @var $tree \TYPO3\CMS\Backend\Tree\View\PageTreeView */ |
| 1788 | 1788 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 1789 | - $tree->init('AND ' . $this->backendUser->getPagePermsClause(1)); |
|
| 1789 | + $tree->init('AND '.$this->backendUser->getPagePermsClause(1)); |
|
| 1790 | 1790 | |
| 1791 | 1791 | $excludeParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $excludeString); |
| 1792 | 1792 | |
@@ -1853,7 +1853,7 @@ discard block |
||
| 1853 | 1853 | |
| 1854 | 1854 | // Title column: |
| 1855 | 1855 | if (!$c) { |
| 1856 | - $titleClm = '<td rowspan="' . count($configurations) . '">' . $pageTitleAndIcon . '</td>'; |
|
| 1856 | + $titleClm = '<td rowspan="'.count($configurations).'">'.$pageTitleAndIcon.'</td>'; |
|
| 1857 | 1857 | } else { |
| 1858 | 1858 | $titleClm = ''; |
| 1859 | 1859 | } |
@@ -1880,45 +1880,45 @@ discard block |
||
| 1880 | 1880 | foreach ($confArray['paramExpanded'] as $gVar => $gVal) { |
| 1881 | 1881 | $paramExpanded .= ' |
| 1882 | 1882 | <tr> |
| 1883 | - <td class="bgColor4-20">' . htmlspecialchars('&' . $gVar . '=') . '<br/>' . |
|
| 1884 | - '(' . count($gVal) . ')' . |
|
| 1883 | + <td class="bgColor4-20">' . htmlspecialchars('&'.$gVar.'=').'<br/>'. |
|
| 1884 | + '('.count($gVal).')'. |
|
| 1885 | 1885 | '</td> |
| 1886 | - <td class="bgColor4" nowrap="nowrap">' . nl2br(htmlspecialchars(implode(chr(10), $gVal))) . '</td> |
|
| 1886 | + <td class="bgColor4" nowrap="nowrap">' . nl2br(htmlspecialchars(implode(chr(10), $gVal))).'</td> |
|
| 1887 | 1887 | </tr> |
| 1888 | 1888 | '; |
| 1889 | 1889 | $calcRes *= count($gVal); |
| 1890 | 1890 | $calcAccu[] = count($gVal); |
| 1891 | 1891 | } |
| 1892 | - $paramExpanded = '<table class="lrPadding c-list param-expanded">' . $paramExpanded . '</table>'; |
|
| 1893 | - $paramExpanded .= 'Comb: ' . implode('*', $calcAccu) . '=' . $calcRes; |
|
| 1892 | + $paramExpanded = '<table class="lrPadding c-list param-expanded">'.$paramExpanded.'</table>'; |
|
| 1893 | + $paramExpanded .= 'Comb: '.implode('*', $calcAccu).'='.$calcRes; |
|
| 1894 | 1894 | |
| 1895 | 1895 | // Options |
| 1896 | 1896 | $optionValues = ''; |
| 1897 | 1897 | if ($confArray['subCfg']['userGroups']) { |
| 1898 | - $optionValues .= 'User Groups: ' . $confArray['subCfg']['userGroups'] . '<br/>'; |
|
| 1898 | + $optionValues .= 'User Groups: '.$confArray['subCfg']['userGroups'].'<br/>'; |
|
| 1899 | 1899 | } |
| 1900 | 1900 | if ($confArray['subCfg']['baseUrl']) { |
| 1901 | - $optionValues .= 'Base Url: ' . $confArray['subCfg']['baseUrl'] . '<br/>'; |
|
| 1901 | + $optionValues .= 'Base Url: '.$confArray['subCfg']['baseUrl'].'<br/>'; |
|
| 1902 | 1902 | } |
| 1903 | 1903 | if ($confArray['subCfg']['procInstrFilter']) { |
| 1904 | - $optionValues .= 'ProcInstr: ' . $confArray['subCfg']['procInstrFilter'] . '<br/>'; |
|
| 1904 | + $optionValues .= 'ProcInstr: '.$confArray['subCfg']['procInstrFilter'].'<br/>'; |
|
| 1905 | 1905 | } |
| 1906 | 1906 | |
| 1907 | 1907 | // Compile row: |
| 1908 | 1908 | $content .= ' |
| 1909 | - <tr class="bgColor' . ($c % 2 ? '-20' : '-10') . '"> |
|
| 1910 | - ' . $titleClm . ' |
|
| 1911 | - <td>' . htmlspecialchars($confKey) . '</td> |
|
| 1912 | - <td>' . nl2br(htmlspecialchars(rawurldecode(trim(str_replace('&', chr(10) . '&', \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $confArray['paramParsed'])))))) . '</td> |
|
| 1913 | - <td>' . $paramExpanded . '</td> |
|
| 1914 | - <td nowrap="nowrap">' . $urlList . '</td> |
|
| 1915 | - <td nowrap="nowrap">' . $optionValues . '</td> |
|
| 1916 | - <td nowrap="nowrap">' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($confArray['subCfg']['procInstrParams.']) . '</td> |
|
| 1909 | + <tr class="bgColor' . ($c % 2 ? '-20' : '-10').'"> |
|
| 1910 | + ' . $titleClm.' |
|
| 1911 | + <td>' . htmlspecialchars($confKey).'</td> |
|
| 1912 | + <td>' . nl2br(htmlspecialchars(rawurldecode(trim(str_replace('&', chr(10).'&', \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $confArray['paramParsed'])))))).'</td> |
|
| 1913 | + <td>' . $paramExpanded.'</td> |
|
| 1914 | + <td nowrap="nowrap">' . $urlList.'</td> |
|
| 1915 | + <td nowrap="nowrap">' . $optionValues.'</td> |
|
| 1916 | + <td nowrap="nowrap">' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($confArray['subCfg']['procInstrParams.']).'</td> |
|
| 1917 | 1917 | </tr>'; |
| 1918 | 1918 | } else { |
| 1919 | - $content .= '<tr class="bgColor' . ($c % 2 ? '-20' : '-10') . '"> |
|
| 1920 | - ' . $titleClm . ' |
|
| 1921 | - <td>' . htmlspecialchars($confKey) . '</td> |
|
| 1919 | + $content .= '<tr class="bgColor'.($c % 2 ? '-20' : '-10').'"> |
|
| 1920 | + ' . $titleClm.' |
|
| 1921 | + <td>' . htmlspecialchars($confKey).'</td> |
|
| 1922 | 1922 | <td colspan="5"><em>No entries</em> (Page is excluded in this configuration)</td> |
| 1923 | 1923 | </tr>'; |
| 1924 | 1924 | } |
@@ -1926,13 +1926,13 @@ discard block |
||
| 1926 | 1926 | $c++; |
| 1927 | 1927 | } |
| 1928 | 1928 | } else { |
| 1929 | - $message = !empty($skipMessage) ? ' (' . $skipMessage . ')' : ''; |
|
| 1929 | + $message = !empty($skipMessage) ? ' ('.$skipMessage.')' : ''; |
|
| 1930 | 1930 | |
| 1931 | 1931 | // Compile row: |
| 1932 | 1932 | $content .= ' |
| 1933 | 1933 | <tr class="bgColor-20" style="border-bottom: 1px solid black;"> |
| 1934 | - <td>' . $pageTitleAndIcon . '</td> |
|
| 1935 | - <td colspan="6"><em>No entries</em>' . $message . '</td> |
|
| 1934 | + <td>' . $pageTitleAndIcon.'</td> |
|
| 1935 | + <td colspan="6"><em>No entries</em>' . $message.'</td> |
|
| 1936 | 1936 | </tr>'; |
| 1937 | 1937 | } |
| 1938 | 1938 | |
@@ -1947,7 +1947,7 @@ discard block |
||
| 1947 | 1947 | $res = $this->db->exec_SELECTquery( |
| 1948 | 1948 | 'count(*) as num', |
| 1949 | 1949 | 'tx_crawler_queue', |
| 1950 | - 'exec_time=0 AND process_scheduled=0 AND scheduled<=' . $this->getCurrentTime() |
|
| 1950 | + 'exec_time=0 AND process_scheduled=0 AND scheduled<='.$this->getCurrentTime() |
|
| 1951 | 1951 | ); |
| 1952 | 1952 | |
| 1953 | 1953 | $count = $this->db->sql_fetch_assoc($res); |
@@ -1998,7 +1998,7 @@ discard block |
||
| 1998 | 1998 | //TODO can't we do that in a clean way? |
| 1999 | 1999 | $releaseStatus = $this->CLI_releaseProcesses($this->CLI_buildProcessId()); |
| 2000 | 2000 | |
| 2001 | - $this->CLI_debug("Unprocessed Items remaining:" . $this->getUnprocessedItemsCount() . " (" . $this->CLI_buildProcessId() . ")"); |
|
| 2001 | + $this->CLI_debug("Unprocessed Items remaining:".$this->getUnprocessedItemsCount()." (".$this->CLI_buildProcessId().")"); |
|
| 2002 | 2002 | $result |= ($this->getUnprocessedItemsCount() > 0 ? self::CLI_STATUS_REMAIN : self::CLI_STATUS_NOTHING_PROCCESSED); |
| 2003 | 2003 | } else { |
| 2004 | 2004 | $result |= self::CLI_STATUS_ABORTED; |
@@ -2082,32 +2082,32 @@ discard block |
||
| 2082 | 2082 | ); |
| 2083 | 2083 | |
| 2084 | 2084 | if ($cliObj->cli_argValue('-o') === 'url') { |
| 2085 | - $cliObj->cli_echo(implode(chr(10), $this->downloadUrls) . chr(10), 1); |
|
| 2085 | + $cliObj->cli_echo(implode(chr(10), $this->downloadUrls).chr(10), 1); |
|
| 2086 | 2086 | } elseif ($cliObj->cli_argValue('-o') === 'exec') { |
| 2087 | - $cliObj->cli_echo("Executing " . count($this->urlList) . " requests right away:\n\n"); |
|
| 2088 | - $cliObj->cli_echo(implode(chr(10), $this->urlList) . chr(10)); |
|
| 2087 | + $cliObj->cli_echo("Executing ".count($this->urlList)." requests right away:\n\n"); |
|
| 2088 | + $cliObj->cli_echo(implode(chr(10), $this->urlList).chr(10)); |
|
| 2089 | 2089 | $cliObj->cli_echo("\nProcessing:\n"); |
| 2090 | 2090 | |
| 2091 | 2091 | foreach ($this->queueEntries as $queueRec) { |
| 2092 | 2092 | $p = unserialize($queueRec['parameters']); |
| 2093 | - $cliObj->cli_echo($p['url'] . ' (' . implode(',', $p['procInstructions']) . ') => '); |
|
| 2093 | + $cliObj->cli_echo($p['url'].' ('.implode(',', $p['procInstructions']).') => '); |
|
| 2094 | 2094 | |
| 2095 | 2095 | $result = $this->readUrlFromArray($queueRec); |
| 2096 | 2096 | |
| 2097 | 2097 | $requestResult = unserialize($result['content']); |
| 2098 | 2098 | if (is_array($requestResult)) { |
| 2099 | - $resLog = is_array($requestResult['log']) ? chr(10) . chr(9) . chr(9) . implode(chr(10) . chr(9) . chr(9), $requestResult['log']) : ''; |
|
| 2100 | - $cliObj->cli_echo('OK: ' . $resLog . chr(10)); |
|
| 2099 | + $resLog = is_array($requestResult['log']) ? chr(10).chr(9).chr(9).implode(chr(10).chr(9).chr(9), $requestResult['log']) : ''; |
|
| 2100 | + $cliObj->cli_echo('OK: '.$resLog.chr(10)); |
|
| 2101 | 2101 | } else { |
| 2102 | - $cliObj->cli_echo('Error checking Crawler Result: ' . substr(preg_replace('/\s+/', ' ', strip_tags($result['content'])), 0, 30000) . '...' . chr(10)); |
|
| 2102 | + $cliObj->cli_echo('Error checking Crawler Result: '.substr(preg_replace('/\s+/', ' ', strip_tags($result['content'])), 0, 30000).'...'.chr(10)); |
|
| 2103 | 2103 | } |
| 2104 | 2104 | } |
| 2105 | 2105 | } elseif ($cliObj->cli_argValue('-o') === 'queue') { |
| 2106 | - $cliObj->cli_echo("Putting " . count($this->urlList) . " entries in queue:\n\n"); |
|
| 2107 | - $cliObj->cli_echo(implode(chr(10), $this->urlList) . chr(10)); |
|
| 2106 | + $cliObj->cli_echo("Putting ".count($this->urlList)." entries in queue:\n\n"); |
|
| 2107 | + $cliObj->cli_echo(implode(chr(10), $this->urlList).chr(10)); |
|
| 2108 | 2108 | } else { |
| 2109 | - $cliObj->cli_echo(count($this->urlList) . " entries found for processing. (Use -o to decide action):\n\n", 1); |
|
| 2110 | - $cliObj->cli_echo(implode(chr(10), $this->urlList) . chr(10), 1); |
|
| 2109 | + $cliObj->cli_echo(count($this->urlList)." entries found for processing. (Use -o to decide action):\n\n", 1); |
|
| 2110 | + $cliObj->cli_echo(implode(chr(10), $this->urlList).chr(10), 1); |
|
| 2111 | 2111 | } |
| 2112 | 2112 | } |
| 2113 | 2113 | |
@@ -2161,7 +2161,7 @@ discard block |
||
| 2161 | 2161 | * @param tx_crawler_cli_im $cliObj Command line object |
| 2162 | 2162 | * @return mixed Array of keys or null if no keys found |
| 2163 | 2163 | */ |
| 2164 | - protected function getConfigurationKeys(tx_crawler_cli_im &$cliObj) |
|
| 2164 | + protected function getConfigurationKeys(tx_crawler_cli_im & $cliObj) |
|
| 2165 | 2165 | { |
| 2166 | 2166 | $parameter = trim($cliObj->cli_argValue('-conf')); |
| 2167 | 2167 | return ($parameter != '' ? \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $parameter) : []); |
@@ -2188,7 +2188,7 @@ discard block |
||
| 2188 | 2188 | $purgeDate = $this->getCurrentTime() - 24 * 60 * 60 * intval($this->extensionSettings['purgeQueueDays']); |
| 2189 | 2189 | $del = $this->db->exec_DELETEquery( |
| 2190 | 2190 | 'tx_crawler_queue', |
| 2191 | - 'exec_time!=0 AND exec_time<' . $purgeDate |
|
| 2191 | + 'exec_time!=0 AND exec_time<'.$purgeDate |
|
| 2192 | 2192 | ); |
| 2193 | 2193 | } |
| 2194 | 2194 | |
@@ -2219,7 +2219,7 @@ discard block |
||
| 2219 | 2219 | //TODO make sure we're not taking assigned queue-entires |
| 2220 | 2220 | $this->db->exec_UPDATEquery( |
| 2221 | 2221 | 'tx_crawler_queue', |
| 2222 | - 'qid IN (' . implode(',', $quidList) . ')', |
|
| 2222 | + 'qid IN ('.implode(',', $quidList).')', |
|
| 2223 | 2223 | [ |
| 2224 | 2224 | 'process_scheduled' => intval($this->getCurrentTime()), |
| 2225 | 2225 | 'process_id' => $processId |
@@ -2230,7 +2230,7 @@ discard block |
||
| 2230 | 2230 | $numberOfAffectedRows = $this->db->sql_affected_rows(); |
| 2231 | 2231 | $this->db->exec_UPDATEquery( |
| 2232 | 2232 | 'tx_crawler_process', |
| 2233 | - "process_id = '" . $processId . "'", |
|
| 2233 | + "process_id = '".$processId."'", |
|
| 2234 | 2234 | [ |
| 2235 | 2235 | 'assigned_items_count' => intval($numberOfAffectedRows) |
| 2236 | 2236 | ] |
@@ -2240,7 +2240,7 @@ discard block |
||
| 2240 | 2240 | $this->db->sql_query('COMMIT'); |
| 2241 | 2241 | } else { |
| 2242 | 2242 | $this->db->sql_query('ROLLBACK'); |
| 2243 | - $this->CLI_debug("Nothing processed due to multi-process collision (" . $this->CLI_buildProcessId() . ")"); |
|
| 2243 | + $this->CLI_debug("Nothing processed due to multi-process collision (".$this->CLI_buildProcessId().")"); |
|
| 2244 | 2244 | return ($result | self::CLI_STATUS_ABORTED); |
| 2245 | 2245 | } |
| 2246 | 2246 | |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | } |
| 2258 | 2258 | |
| 2259 | 2259 | if (!$this->CLI_checkIfProcessIsActive($this->CLI_buildProcessId())) { |
| 2260 | - $this->CLI_debug("conflict / timeout (" . $this->CLI_buildProcessId() . ")"); |
|
| 2260 | + $this->CLI_debug("conflict / timeout (".$this->CLI_buildProcessId().")"); |
|
| 2261 | 2261 | |
| 2262 | 2262 | //TODO might need an additional returncode |
| 2263 | 2263 | $result |= self::CLI_STATUS_ABORTED; |
@@ -2267,10 +2267,10 @@ discard block |
||
| 2267 | 2267 | |
| 2268 | 2268 | sleep(intval($sleepAfterFinish)); |
| 2269 | 2269 | |
| 2270 | - $msg = 'Rows: ' . $counter; |
|
| 2271 | - $this->CLI_debug($msg . " (" . $this->CLI_buildProcessId() . ")"); |
|
| 2270 | + $msg = 'Rows: '.$counter; |
|
| 2271 | + $this->CLI_debug($msg." (".$this->CLI_buildProcessId().")"); |
|
| 2272 | 2272 | } else { |
| 2273 | - $this->CLI_debug("Nothing within queue which needs to be processed (" . $this->CLI_buildProcessId() . ")"); |
|
| 2273 | + $this->CLI_debug("Nothing within queue which needs to be processed (".$this->CLI_buildProcessId().")"); |
|
| 2274 | 2274 | } |
| 2275 | 2275 | |
| 2276 | 2276 | if ($counter > 0) { |
@@ -2338,7 +2338,7 @@ discard block |
||
| 2338 | 2338 | |
| 2339 | 2339 | // if there are less than allowed active processes then add a new one |
| 2340 | 2340 | if ($processCount < intval($this->extensionSettings['processLimit'])) { |
| 2341 | - $this->CLI_debug("add " . $this->CLI_buildProcessId() . " (" . ($processCount + 1) . "/" . intval($this->extensionSettings['processLimit']) . ")"); |
|
| 2341 | + $this->CLI_debug("add ".$this->CLI_buildProcessId()." (".($processCount + 1)."/".intval($this->extensionSettings['processLimit']).")"); |
|
| 2342 | 2342 | |
| 2343 | 2343 | // create new process record |
| 2344 | 2344 | $this->db->exec_INSERTquery( |
@@ -2351,7 +2351,7 @@ discard block |
||
| 2351 | 2351 | ] |
| 2352 | 2352 | ); |
| 2353 | 2353 | } else { |
| 2354 | - $this->CLI_debug("Processlimit reached (" . ($processCount) . "/" . intval($this->extensionSettings['processLimit']) . ")"); |
|
| 2354 | + $this->CLI_debug("Processlimit reached (".($processCount)."/".intval($this->extensionSettings['processLimit']).")"); |
|
| 2355 | 2355 | $ret = false; |
| 2356 | 2356 | } |
| 2357 | 2357 | |
@@ -2377,7 +2377,7 @@ discard block |
||
| 2377 | 2377 | } |
| 2378 | 2378 | |
| 2379 | 2379 | if (!count($releaseIds) > 0) { |
| 2380 | - return false; //nothing to release |
|
| 2380 | + return false; //nothing to release |
|
| 2381 | 2381 | } |
| 2382 | 2382 | |
| 2383 | 2383 | if (!$withinLock) { |
@@ -2412,14 +2412,14 @@ discard block |
||
| 2412 | 2412 | // mark all requested processes as non-active |
| 2413 | 2413 | $this->db->exec_UPDATEquery( |
| 2414 | 2414 | 'tx_crawler_process', |
| 2415 | - 'process_id IN (\'' . implode('\',\'', $releaseIds) . '\') AND deleted=0', |
|
| 2415 | + 'process_id IN (\''.implode('\',\'', $releaseIds).'\') AND deleted=0', |
|
| 2416 | 2416 | [ |
| 2417 | 2417 | 'active' => '0' |
| 2418 | 2418 | ] |
| 2419 | 2419 | ); |
| 2420 | 2420 | $this->db->exec_UPDATEquery( |
| 2421 | 2421 | 'tx_crawler_queue', |
| 2422 | - 'exec_time=0 AND process_id IN ("' . implode('","', $releaseIds) . '")', |
|
| 2422 | + 'exec_time=0 AND process_id IN ("'.implode('","', $releaseIds).'")', |
|
| 2423 | 2423 | [ |
| 2424 | 2424 | 'process_scheduled' => 0, |
| 2425 | 2425 | 'process_id' => '' |
@@ -2459,7 +2459,7 @@ discard block |
||
| 2459 | 2459 | $res = $this->db->exec_SELECTquery( |
| 2460 | 2460 | 'process_id,active,ttl', |
| 2461 | 2461 | 'tx_crawler_process', |
| 2462 | - 'process_id = \'' . $pid . '\' AND deleted=0', |
|
| 2462 | + 'process_id = \''.$pid.'\' AND deleted=0', |
|
| 2463 | 2463 | '', |
| 2464 | 2464 | 'ttl', |
| 2465 | 2465 | '0,1' |
@@ -2503,7 +2503,7 @@ discard block |
||
| 2503 | 2503 | public function CLI_debug($msg) |
| 2504 | 2504 | { |
| 2505 | 2505 | if (intval($this->extensionSettings['processDebug'])) { |
| 2506 | - echo $msg . "\n"; |
|
| 2506 | + echo $msg."\n"; |
|
| 2507 | 2507 | flush(); |
| 2508 | 2508 | } |
| 2509 | 2509 | } |
@@ -2521,7 +2521,7 @@ discard block |
||
| 2521 | 2521 | |
| 2522 | 2522 | $cmd = escapeshellcmd($this->extensionSettings['phpPath']); |
| 2523 | 2523 | $cmd .= ' '; |
| 2524 | - $cmd .= escapeshellarg(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler') . 'cli/bootstrap.php'); |
|
| 2524 | + $cmd .= escapeshellarg(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler').'cli/bootstrap.php'); |
|
| 2525 | 2525 | $cmd .= ' '; |
| 2526 | 2526 | $cmd .= escapeshellarg($this->getFrontendBasePath()); |
| 2527 | 2527 | $cmd .= ' '; |
@@ -2531,10 +2531,10 @@ discard block |
||
| 2531 | 2531 | |
| 2532 | 2532 | $startTime = microtime(true); |
| 2533 | 2533 | $content = $this->executeShellCommand($cmd); |
| 2534 | - $this->log($url . ' ' . (microtime(true) - $startTime)); |
|
| 2534 | + $this->log($url.' '.(microtime(true) - $startTime)); |
|
| 2535 | 2535 | |
| 2536 | 2536 | $result = [ |
| 2537 | - 'request' => implode("\r\n", $requestHeaders) . "\r\n\r\n", |
|
| 2537 | + 'request' => implode("\r\n", $requestHeaders)."\r\n\r\n", |
|
| 2538 | 2538 | 'headers' => '', |
| 2539 | 2539 | 'content' => $content |
| 2540 | 2540 | ]; |
@@ -2555,7 +2555,7 @@ discard block |
||
| 2555 | 2555 | $scheduledAgeInSeconds = $this->extensionSettings['cleanUpScheduledAge'] * 86400; |
| 2556 | 2556 | |
| 2557 | 2557 | $now = time(); |
| 2558 | - $condition = '(exec_time<>0 AND exec_time<' . ($now - $processedAgeInSeconds) . ') OR scheduled<=' . ($now - $scheduledAgeInSeconds); |
|
| 2558 | + $condition = '(exec_time<>0 AND exec_time<'.($now - $processedAgeInSeconds).') OR scheduled<='.($now - $scheduledAgeInSeconds); |
|
| 2559 | 2559 | $this->flushQueue($condition); |
| 2560 | 2560 | } |
| 2561 | 2561 | |
@@ -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(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | if ($currentPendingItems == 0) { |
| 107 | 107 | if ($this->verbose) { |
| 108 | - echo 'Finished...' . chr(10); |
|
| 108 | + echo 'Finished...'.chr(10); |
|
| 109 | 109 | } |
| 110 | 110 | break; |
| 111 | 111 | } |
@@ -117,16 +117,16 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | sleep(1); |
| 119 | 119 | if ($nextTimeOut < time()) { |
| 120 | - $timedOutProcesses = $this->processRepository->findAll('', 'DESC', null, 0, 'ttl >' . $nextTimeOut); |
|
| 120 | + $timedOutProcesses = $this->processRepository->findAll('', 'DESC', null, 0, 'ttl >'.$nextTimeOut); |
|
| 121 | 121 | $nextTimeOut = time() + $this->timeToLive; |
| 122 | 122 | if ($this->verbose) { |
| 123 | - echo 'Cleanup' . implode(',', $timedOutProcesses->getProcessIds()) . chr(10); |
|
| 123 | + echo 'Cleanup'.implode(',', $timedOutProcesses->getProcessIds()).chr(10); |
|
| 124 | 124 | } |
| 125 | 125 | $this->crawlerObj->CLI_releaseProcesses($timedOutProcesses->getProcessIds(), true); |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | if ($currentPendingItems > 0 && $this->verbose) { |
| 129 | - echo 'Stop with timeout' . chr(10); |
|
| 129 | + echo 'Stop with timeout'.chr(10); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | protected function reportItemStatus() |
| 137 | 137 | { |
| 138 | - echo 'Pending:' . $this->queueRepository->countAllPendingItems() . ' / Assigned:' . $this->queueRepository->countAllAssignedPendingItems() . chr(10); |
|
| 138 | + echo 'Pending:'.$this->queueRepository->countAllPendingItems().' / Assigned:'.$this->queueRepository->countAllAssignedPendingItems().chr(10); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -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 | - echo 'Start ' . $startProcessCount . ' new processes (Running:' . $currentProcesses . ')'; |
|
| 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,10 +200,10 @@ 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'; |
| 207 | - return $phpPath . $pathToTypo3 . $cliPart; |
|
| 207 | + return $phpPath.$pathToTypo3.$cliPart; |
|
| 208 | 208 | } |
| 209 | 209 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | white-space: nowrap; vertical-align: top; |
| 167 | 167 | } |
| 168 | 168 | --></style> |
| 169 | - <link rel="stylesheet" type="text/css" href="' . $BACK_PATH . '../typo3conf/ext/crawler/template/res.css" /> |
|
| 169 | + <link rel="stylesheet" type="text/css" href="' . $BACK_PATH.'../typo3conf/ext/crawler/template/res.css" /> |
|
| 170 | 170 | '; |
| 171 | 171 | |
| 172 | 172 | // Type function menu: |
@@ -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 | - $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') . ': ' . |
|
| 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').': '. |
|
| 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; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | ) { |
| 298 | 298 | $code = ' |
| 299 | 299 | <tr> |
| 300 | - <td colspan="7"><b>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected') . '</b></td> |
|
| 300 | + <td colspan="7"><b>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td> |
|
| 301 | 301 | </tr>'; |
| 302 | 302 | } else { |
| 303 | 303 | if ($this->submitCrawlUrls) { |
@@ -307,12 +307,12 @@ discard block |
||
| 307 | 307 | if ($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication) { |
| 308 | 308 | $username = $BE_USER->user['username']; |
| 309 | 309 | } |
| 310 | - $reason->setDetailText('The user ' . $username . ' added pages to the crawler queue manually '); |
|
| 310 | + $reason->setDetailText('The user '.$username.' added pages to the crawler queue manually '); |
|
| 311 | 311 | |
| 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 | |
@@ -333,25 +333,25 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | $output = ''; |
| 335 | 335 | if ($code) { |
| 336 | - $output .= '<h3>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration') . ':</h3>'; |
|
| 337 | - $output .= '<input type="hidden" name="id" value="' . intval($this->pObj->id) . '" />'; |
|
| 336 | + $output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>'; |
|
| 337 | + $output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />'; |
|
| 338 | 338 | |
| 339 | 339 | if (!$this->submitCrawlUrls) { |
| 340 | - $output .= $this->drawURLs_cfgSelectors() . '<br />'; |
|
| 341 | - $output .= '<input type="submit" name="_update" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate') . '" /> '; |
|
| 342 | - $output .= '<input type="submit" name="_crawl" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl') . '" /> '; |
|
| 343 | - $output .= '<input type="submit" name="_download" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload') . '" /><br /><br />'; |
|
| 344 | - $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count') . ': ' . count(array_keys($this->duplicateTrack)) . '<br />'; |
|
| 345 | - $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime') . ': ' . date('H:i:s', time()) . '<br />'; |
|
| 340 | + $output .= $this->drawURLs_cfgSelectors().'<br />'; |
|
| 341 | + $output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> '; |
|
| 342 | + $output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> '; |
|
| 343 | + $output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />'; |
|
| 344 | + $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />'; |
|
| 345 | + $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).'<br />'; |
|
| 346 | 346 | $output .= '<br /> |
| 347 | 347 | <table class="lrPadding c-list url-table">' . |
| 348 | - $this->drawURLs_printTableHeader() . |
|
| 349 | - $code . |
|
| 348 | + $this->drawURLs_printTableHeader(). |
|
| 349 | + $code. |
|
| 350 | 350 | '</table>'; |
| 351 | 351 | } else { |
| 352 | - $output .= count(array_keys($this->duplicateTrack)) . ' ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted') . '. <br /><br />'; |
|
| 353 | - $output .= '<input type="submit" name="_" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue') . '" />'; |
|
| 354 | - $output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog') . '" />'; |
|
| 352 | + $output .= count(array_keys($this->duplicateTrack)).' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted').'. <br /><br />'; |
|
| 353 | + $output .= '<input type="submit" name="_" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue').'" />'; |
|
| 354 | + $output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog').'" />'; |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
@@ -360,11 +360,11 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | // Creating output header: |
| 362 | 362 | $mimeType = 'application/octet-stream'; |
| 363 | - Header('Content-Type: ' . $mimeType); |
|
| 363 | + Header('Content-Type: '.$mimeType); |
|
| 364 | 364 | Header('Content-Disposition: attachment; filename=CrawlerUrls.txt'); |
| 365 | 365 | |
| 366 | 366 | // Printing the content of the CSV lines: |
| 367 | - echo implode(chr(13) . chr(10), $this->downloadUrls); |
|
| 367 | + echo implode(chr(13).chr(10), $this->downloadUrls); |
|
| 368 | 368 | |
| 369 | 369 | // Exits: |
| 370 | 370 | exit; |
@@ -443,13 +443,13 @@ discard block |
||
| 443 | 443 | $output = ' |
| 444 | 444 | <table class="lrPadding c-list"> |
| 445 | 445 | <tr class="bgColor5 tableheader"> |
| 446 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.depth') . ':</td> |
|
| 447 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configurations') . ':</td> |
|
| 448 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduled') . ':</td> |
|
| 446 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.depth').':</td> |
|
| 447 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configurations').':</td> |
|
| 448 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduled').':</td> |
|
| 449 | 449 | </tr> |
| 450 | 450 | <tr class="bgColor4"> |
| 451 | 451 | <td valign="top">' . implode('</td> |
| 452 | - <td valign="top">', $cell) . '</td> |
|
| 452 | + <td valign="top">', $cell).'</td> |
|
| 453 | 453 | </tr> |
| 454 | 454 | </table>'; |
| 455 | 455 | |
@@ -465,13 +465,13 @@ discard block |
||
| 465 | 465 | { |
| 466 | 466 | $content = ' |
| 467 | 467 | <tr class="bgColor5 tableheader"> |
| 468 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle') . ':</td> |
|
| 469 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.key') . ':</td> |
|
| 470 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parametercfg') . ':</td> |
|
| 471 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.values') . ':</td> |
|
| 472 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.urls') . ':</td> |
|
| 473 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.options') . ':</td> |
|
| 474 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parameters') . ':</td> |
|
| 468 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td> |
|
| 469 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.key').':</td> |
|
| 470 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parametercfg').':</td> |
|
| 471 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.values').':</td> |
|
| 472 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.urls').':</td> |
|
| 473 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.options').':</td> |
|
| 474 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parameters').':</td> |
|
| 475 | 475 | </tr>'; |
| 476 | 476 | |
| 477 | 477 | return $content; |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) { |
| 513 | 513 | |
| 514 | 514 | // Get entry record: |
| 515 | - list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
| 515 | + list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
| 516 | 516 | |
| 517 | 517 | // Explode values: |
| 518 | 518 | $resStatus = $this->getResStatus($q_entry); |
@@ -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 | |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | // Drawing tree: |
| 545 | 545 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 546 | 546 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| 547 | - $tree->init('AND ' . $perms_clause); |
|
| 547 | + $tree->init('AND '.$perms_clause); |
|
| 548 | 548 | |
| 549 | 549 | // Set root row: |
| 550 | 550 | $HTML = \AOE\Crawler\Utility\IconUtility::getIconForRecord('pages', $this->pObj->pageinfo); |
@@ -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) { |
@@ -575,27 +575,27 @@ discard block |
||
| 575 | 575 | $code = ''; |
| 576 | 576 | $code .= $this->drawLog_addRows( |
| 577 | 577 | $showSetId, |
| 578 | - 'Set ID: ' . $showSetId |
|
| 578 | + 'Set ID: '.$showSetId |
|
| 579 | 579 | ); |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | if ($code) { |
| 583 | 583 | $output .= ' |
| 584 | 584 | <br /><br /> |
| 585 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist') . '" name="_reload" /> |
|
| 586 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv') . '" name="_csv" /> |
|
| 587 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushvisiblequeue') . '" name="_flush" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" /> |
|
| 588 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushfullqueue') . '" name="_flush_all" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" /> |
|
| 589 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
| 590 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
| 585 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist').'" name="_reload" /> |
|
| 586 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv').'" name="_csv" /> |
|
| 587 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushvisiblequeue').'" name="_flush" onclick="return confirm(\''.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure').'\');" /> |
|
| 588 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushfullqueue').'" name="_flush_all" onclick="return confirm(\''.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure').'\');" /> |
|
| 589 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
| 590 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
| 591 | 591 | <br /> |
| 592 | - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime') . ': ' . date('H:i:s', time()) . ' |
|
| 592 | + ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).' |
|
| 593 | 593 | <br /><br /> |
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | <table class="lrPadding c-list crawlerlog">' . |
| 597 | - $this->drawLog_printTableHeader() . |
|
| 598 | - $code . |
|
| 597 | + $this->drawLog_printTableHeader(). |
|
| 598 | + $code. |
|
| 599 | 599 | '</table>'; |
| 600 | 600 | } |
| 601 | 601 | } else { // Otherwise show available sets: |
@@ -609,19 +609,19 @@ discard block |
||
| 609 | 609 | |
| 610 | 610 | $code = ' |
| 611 | 611 | <tr class="bgColor5 tableheader"> |
| 612 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td> |
|
| 613 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count') . 't:</td> |
|
| 614 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time') . ':</td> |
|
| 612 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td> |
|
| 613 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').'t:</td> |
|
| 614 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time').':</td> |
|
| 615 | 615 | </tr> |
| 616 | 616 | '; |
| 617 | 617 | |
| 618 | 618 | $cc = 0; |
| 619 | 619 | foreach ($setList as $set) { |
| 620 | 620 | $code .= ' |
| 621 | - <tr class="bgColor' . ($cc % 2 ? '-20' : '-10') . '"> |
|
| 622 | - <td><a href="' . htmlspecialchars('index.php?setID=' . $set['set_id']) . '">' . $set['set_id'] . '</a></td> |
|
| 623 | - <td>' . $set['count_value'] . '</td> |
|
| 624 | - <td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']) . '</td> |
|
| 621 | + <tr class="bgColor' . ($cc % 2 ? '-20' : '-10').'"> |
|
| 622 | + <td><a href="' . htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td> |
|
| 623 | + <td>' . $set['count_value'].'</td> |
|
| 624 | + <td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td> |
|
| 625 | 625 | </tr> |
| 626 | 626 | '; |
| 627 | 627 | |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | $output .= ' |
| 632 | 632 | <br /><br /> |
| 633 | 633 | <table class="lrPadding c-list">' . |
| 634 | - $code . |
|
| 634 | + $code. |
|
| 635 | 635 | '</table>'; |
| 636 | 636 | } |
| 637 | 637 | } |
@@ -668,11 +668,11 @@ discard block |
||
| 668 | 668 | |
| 669 | 669 | // Creating output header: |
| 670 | 670 | $mimeType = 'application/octet-stream'; |
| 671 | - Header('Content-Type: ' . $mimeType); |
|
| 671 | + Header('Content-Type: '.$mimeType); |
|
| 672 | 672 | Header('Content-Disposition: attachment; filename=CrawlerLog.csv'); |
| 673 | 673 | |
| 674 | 674 | // Printing the content of the CSV lines: |
| 675 | - echo implode(chr(13) . chr(10), $csvLines); |
|
| 675 | + echo implode(chr(13).chr(10), $csvLines); |
|
| 676 | 676 | |
| 677 | 677 | // Exits: |
| 678 | 678 | exit; |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | |
| 725 | 725 | // Title column: |
| 726 | 726 | if (!$c) { |
| 727 | - $titleClm = '<td rowspan="' . count($res) . '">' . $titleString . '</td>'; |
|
| 727 | + $titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>'; |
|
| 728 | 728 | } else { |
| 729 | 729 | $titleClm = ''; |
| 730 | 730 | } |
@@ -743,11 +743,11 @@ discard block |
||
| 743 | 743 | if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
| 744 | 744 | $rowData['result_log'] = $resLog; |
| 745 | 745 | } else { |
| 746 | - $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
| 746 | + $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
| 747 | 747 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
| 748 | 748 | } |
| 749 | 749 | $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus, 50); |
| 750 | - $rowData['url'] = '<a href="' . htmlspecialchars($parameters['url']) . '" target="_newWIndow">' . htmlspecialchars($parameters['url']) . '</a>'; |
|
| 750 | + $rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>'; |
|
| 751 | 751 | $rowData['feUserGroupList'] = $parameters['feUserGroupList']; |
| 752 | 752 | $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ', $parameters['procInstructions']) : ''; |
| 753 | 753 | $rowData['set_id'] = $vv['set_id']; |
@@ -759,21 +759,21 @@ 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') . '"> |
|
| 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>'; |
|
| 766 | + <tr class="bgColor' . ($c % 2 ? '-20' : '-10').'"> |
|
| 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>'; |
|
| 770 | 770 | foreach ($rowData as $fKey => $value) { |
| 771 | 771 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) { |
| 772 | 772 | $content .= ' |
| 773 | - <td>' . $value . '</td>'; |
|
| 773 | + <td>' . $value.'</td>'; |
|
| 774 | 774 | } else { |
| 775 | 775 | $content .= ' |
| 776 | - <td>' . nl2br(htmlspecialchars($value)) . '</td>'; |
|
| 776 | + <td>' . nl2br(htmlspecialchars($value)).'</td>'; |
|
| 777 | 777 | } |
| 778 | 778 | } |
| 779 | 779 | $content .= ' |
@@ -794,8 +794,8 @@ discard block |
||
| 794 | 794 | // Compile row: |
| 795 | 795 | $content = ' |
| 796 | 796 | <tr class="bgColor-20"> |
| 797 | - <td>' . $titleString . '</td> |
|
| 798 | - <td colspan="' . $colSpan . '"><em>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noentries') . '</em></td> |
|
| 797 | + <td>' . $titleString.'</td> |
|
| 798 | + <td colspan="' . $colSpan.'"><em>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noentries').'</em></td> |
|
| 799 | 799 | </tr>'; |
| 800 | 800 | } |
| 801 | 801 | |
@@ -830,22 +830,22 @@ discard block |
||
| 830 | 830 | { |
| 831 | 831 | $content = ' |
| 832 | 832 | <tr class="bgColor5 tableheader"> |
| 833 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle') . ':</td> |
|
| 834 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid') . ':</td> |
|
| 833 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td> |
|
| 834 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid').':</td> |
|
| 835 | 835 | <td> </td>' . |
| 836 | 836 | ($this->pObj->MOD_SETTINGS['log_resultLog'] ? ' |
| 837 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog') . ':</td>' : ' |
|
| 838 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime') . ':</td> |
|
| 839 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime') . ':</td>') . ' |
|
| 840 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.status') . ':</td> |
|
| 841 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.url') . ':</td> |
|
| 842 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups') . ':</td> |
|
| 843 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr') . ':</td> |
|
| 844 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td>' . |
|
| 837 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog').':</td>' : ' |
|
| 838 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime').':</td> |
|
| 839 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime').':</td>').' |
|
| 840 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.status').':</td> |
|
| 841 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.url').':</td> |
|
| 842 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups').':</td> |
|
| 843 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr').':</td> |
|
| 844 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td>'. |
|
| 845 | 845 | ($this->pObj->MOD_SETTINGS['log_feVars'] ? ' |
| 846 | - <td>' . htmlspecialchars('TSFE->id') . '</td> |
|
| 847 | - <td>' . htmlspecialchars('TSFE->gr_list') . '</td> |
|
| 848 | - <td>' . htmlspecialchars('TSFE->no_cache') . '</td>' : '') . ' |
|
| 846 | + <td>' . htmlspecialchars('TSFE->id').'</td> |
|
| 847 | + <td>' . htmlspecialchars('TSFE->gr_list').'</td> |
|
| 848 | + <td>' . htmlspecialchars('TSFE->no_cache').'</td>' : '').' |
|
| 849 | 849 | </tr>'; |
| 850 | 850 | |
| 851 | 851 | return $content; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | } |
| 888 | 888 | $resLog = is_array($requestResult['log']) ? implode(chr(10), $requestResult['log']) : ''; |
| 889 | 889 | } else { |
| 890 | - $resStatus = 'Error: ' . substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, 10000) . '...'; |
|
| 890 | + $resStatus = 'Error: '.substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, 10000).'...'; |
|
| 891 | 891 | } |
| 892 | 892 | } else { |
| 893 | 893 | $resStatus = '-'; |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | |
| 940 | 940 | $listView = new tx_crawler_view_process_list(); |
| 941 | 941 | $listView->setPageId($this->pObj->id); |
| 942 | - $listView->setIconPath($BACK_PATH . '../typo3conf/ext/crawler/template/process/res/img/'); |
|
| 942 | + $listView->setIconPath($BACK_PATH.'../typo3conf/ext/crawler/template/process/res/img/'); |
|
| 943 | 943 | $listView->setProcessCollection($allProcesses); |
| 944 | 944 | $listView->setCliPath($this->processManager->getCrawlerCliPath()); |
| 945 | 945 | $listView->setIsCrawlerEnabled(!$crawler->getDisabled() && !$this->isErrorDetected); |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | $output = $listView->render(); |
| 958 | 958 | |
| 959 | 959 | if ($paginationView->getTotalPagesCount() > 1) { |
| 960 | - $output .= ' <br />' . $paginationView->render(); |
|
| 960 | + $output .= ' <br />'.$paginationView->render(); |
|
| 961 | 961 | } |
| 962 | 962 | |
| 963 | 963 | return $output; |
@@ -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 | } |
@@ -192,12 +192,12 @@ discard block |
||
| 192 | 192 | //if the same page is scheduled for the same time and has not be executed? |
| 193 | 193 | if ($schedule_timestamp == 0) { |
| 194 | 194 | //untimed elements need an exec_time with 0 because they can occure multiple times |
| 195 | - $where = 'page_id=' . $page_uid . ' AND exec_time = 0 AND scheduled=' . $schedule_timestamp; |
|
| 195 | + $where = 'page_id='.$page_uid.' AND exec_time = 0 AND scheduled='.$schedule_timestamp; |
|
| 196 | 196 | } else { |
| 197 | 197 | //timed elementes have got a fixed schedule time, if a record with this time |
| 198 | 198 | //exists it is maybe queued for the future, or is has been queue for the past and therefore |
| 199 | 199 | //also been processed. |
| 200 | - $where = 'page_id=' . $page_uid . ' AND scheduled=' . $schedule_timestamp; |
|
| 200 | + $where = 'page_id='.$page_uid.' AND scheduled='.$schedule_timestamp; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($GLOBALS['TYPO3_DB']->exec_SELECTquery( |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | $isPageInQueue = false; |
| 229 | 229 | |
| 230 | - $whereClause = 'page_id = ' . (integer)$uid; |
|
| 230 | + $whereClause = 'page_id = '.(integer) $uid; |
|
| 231 | 231 | |
| 232 | 232 | if (false !== $unprocessed_only) { |
| 233 | 233 | $whereClause .= ' AND exec_time = 0'; |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | if (false !== $timestamp) { |
| 241 | - $whereClause .= ' AND scheduled = ' . (integer)$timestamp; |
|
| 241 | + $whereClause .= ' AND scheduled = '.(integer) $timestamp; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows( |
@@ -267,10 +267,10 @@ discard block |
||
| 267 | 267 | { |
| 268 | 268 | $uid = intval($uid); |
| 269 | 269 | $query = 'max(scheduled) as latest'; |
| 270 | - $where = ' page_id = ' . $uid; |
|
| 270 | + $where = ' page_id = '.$uid; |
|
| 271 | 271 | |
| 272 | 272 | if ($future_crawldates_only) { |
| 273 | - $where .= ' AND scheduled > ' . time(); |
|
| 273 | + $where .= ' AND scheduled > '.time(); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | if ($unprocessed_only) { |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $limit = $GLOBALS['TYPO3_DB']->fullQuoteStr($limit, 'tx_crawler_queue'); |
| 304 | 304 | |
| 305 | 305 | $query = 'scheduled, exec_time, set_id'; |
| 306 | - $where = ' page_id = ' . $uid; |
|
| 306 | + $where = ' page_id = '.$uid; |
|
| 307 | 307 | |
| 308 | 308 | $limit_query = ($limit) ? $limit : null; |
| 309 | 309 | |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | { |
| 381 | 381 | $qid = intval($qid); |
| 382 | 382 | $table = 'tx_crawler_queue'; |
| 383 | - $where = ' qid=' . $qid; |
|
| 383 | + $where = ' qid='.$qid; |
|
| 384 | 384 | $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, $where); |
| 385 | 385 | } |
| 386 | 386 | |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | //@todo: ask service to exclude current call for special reasons: for example no relevance because the language version is not affected |
| 50 | 50 | |
| 51 | 51 | list($queueId, $hash) = explode(':', $_SERVER['HTTP_X_T3CRAWLER']); |
| 52 | - list($queueRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid=' . intval($queueId)); |
|
| 52 | + list($queueRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid='.intval($queueId)); |
|
| 53 | 53 | |
| 54 | 54 | // If a crawler record was found and hash was matching, set it up: |
| 55 | - if (is_array($queueRec) && $hash === md5($queueRec['qid'] . '|' . $queueRec['set_id'] . '|' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) { |
|
| 55 | + if (is_array($queueRec) && $hash === md5($queueRec['qid'].'|'.$queueRec['set_id'].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) { |
|
| 56 | 56 | $params['pObj']->applicationData['tx_crawler']['running'] = true; |
| 57 | 57 | $params['pObj']->applicationData['tx_crawler']['parameters'] = unserialize($queueRec['parameters']); |
| 58 | 58 | $params['pObj']->applicationData['tx_crawler']['log'] = []; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $params['pObj']->fe_user->user = []; |
| 81 | 81 | } |
| 82 | 82 | $params['pObj']->fe_user->user['usergroup'] = $grList; |
| 83 | - $params['pObj']->applicationData['tx_crawler']['log'][] = 'User Groups: ' . $grList; |
|
| 83 | + $params['pObj']->applicationData['tx_crawler']['log'][] = 'User Groups: '.$grList; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['pollSuccess'] as $pollable) { |
| 126 | 126 | if (is_array($params['pObj']->applicationData['tx_crawler']['content']['parameters']['procInstructions']) && in_array($pollable, $params['pObj']->applicationData['tx_crawler']['content']['parameters']['procInstructions'])) { |
| 127 | 127 | if (empty($params['pObj']->applicationData['tx_crawler']['success'][$pollable])) { |
| 128 | - $params['pObj']->applicationData['tx_crawler']['errorlog'][] = 'Error: Pollable extension (' . $pollable . ') did not complete successfully.'; |
|
| 128 | + $params['pObj']->applicationData['tx_crawler']['errorlog'][] = 'Error: Pollable extension ('.$pollable.') did not complete successfully.'; |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $str = serialize($params['pObj']->applicationData['tx_crawler']); |
| 136 | 136 | //just make sure that no other output distracts this |
| 137 | 137 | ob_clean(); |
| 138 | - header('Content-Length: ' . strlen($str)); |
|
| 138 | + header('Content-Length: '.strlen($str)); |
|
| 139 | 139 | echo $str; |
| 140 | 140 | // Exit since we don't want anymore output! |
| 141 | 141 | exit; |