@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->tableName, |
67 | 67 | $where, |
68 | 68 | '', |
69 | - htmlspecialchars($orderField) . ' ' . htmlspecialchars($orderDirection), |
|
69 | + htmlspecialchars($orderField).' '.htmlspecialchars($orderDirection), |
|
70 | 70 | self::getLimitFromItemCountAndOffset($itemCount, $offset) |
71 | 71 | ); |
72 | 72 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function countNotTimeouted($ttl) |
113 | 113 | { |
114 | - return $this->countByWhere('deleted = 0 AND ttl > ' . intval($ttl)); |
|
114 | + return $this->countByWhere('deleted = 0 AND ttl > '.intval($ttl)); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | $itemCount = filter_var($itemCount, FILTER_VALIDATE_INT, ['options' => ['min_range' => 1, 'default' => 20]]); |
129 | 129 | $offset = filter_var($offset, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0, 'default' => 0]]); |
130 | - $limit = $offset . ', ' . $itemCount; |
|
130 | + $limit = $offset.', '.$itemCount; |
|
131 | 131 | |
132 | 132 | return $limit; |
133 | 133 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | * This method is used to set the uid of the queue entry |
112 | 112 | * where the reason is relevant for. |
113 | 113 | * |
114 | - * @param int $entry_id |
|
114 | + * @param int $entry_uid |
|
115 | 115 | */ |
116 | 116 | public function setQueueEntryUid($entry_uid) |
117 | 117 | { |
@@ -71,8 +71,11 @@ |
||
71 | 71 | </div> |
72 | 72 | <?php elseif ($process->getState() == 'cancelled'): ?> |
73 | 73 | <?php echo $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.cancelled'); ?> |
74 | - <?php else: ?> |
|
75 | - <?php echo $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.success'); ?> |
|
74 | + <?php else { |
|
75 | + : ?> |
|
76 | + <?php echo $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.success'); |
|
77 | +} |
|
78 | +?> |
|
76 | 79 | <?php endif; ?> |
77 | 80 | </td> |
78 | 81 | </tr> |
@@ -53,16 +53,16 @@ |
||
53 | 53 | </thead> |
54 | 54 | <tbody> |
55 | 55 | <?php foreach ($this->getProcessCollection() as $process): /* @var $process tx_crawler_domain_process */ ?> |
56 | - <tr class="<?php echo (++$count % 2 == 0) ? 'odd': 'even' ?>"> |
|
56 | + <tr class="<?php echo (++$count % 2 == 0) ? 'odd' : 'even' ?>"> |
|
57 | 57 | <td><?php echo $this->getIconForState(htmlspecialchars($process->getState())); ?></td> |
58 | 58 | <td><?php echo htmlspecialchars($process->getProcess_id()); ?></td> |
59 | 59 | <td><?php echo htmlspecialchars($this->asDate($process->getTimeForFirstItem())); ?></td> |
60 | 60 | <td><?php echo htmlspecialchars($this->asDate($process->getTimeForLastItem())); ?></td> |
61 | - <td><?php echo htmlspecialchars(floor($process->getRuntime()/ 60)); ?> min. <?php echo htmlspecialchars($process->getRuntime()) % 60 ?> sec.</td> |
|
61 | + <td><?php echo htmlspecialchars(floor($process->getRuntime() / 60)); ?> min. <?php echo htmlspecialchars($process->getRuntime()) % 60 ?> sec.</td> |
|
62 | 62 | <td><?php echo htmlspecialchars($this->asDate($process->getTTL())); ?></td> |
63 | 63 | <td><?php echo htmlspecialchars($process->countItemsProcessed()); ?></td> |
64 | 64 | <td><?php echo htmlspecialchars($process->countItemsAssigned()); ?></td> |
65 | - <td><?php echo htmlspecialchars($process->countItemsToProcess()+$process->countItemsProcessed()); ?></td> |
|
65 | + <td><?php echo htmlspecialchars($process->countItemsToProcess() + $process->countItemsProcessed()); ?></td> |
|
66 | 66 | <td> |
67 | 67 | <?php if ($process->getState() == 'running'): ?> |
68 | 68 | <div class="crawlerprocessprogress" style="width: 200px;"> |
@@ -66,7 +66,7 @@ |
||
66 | 66 | { |
67 | 67 | $db = $this->getDB(); |
68 | 68 | $where = 'process_id_completed='.$db->fullQuoteStr($process->getProcess_id(), $this->tableName). |
69 | - ' AND exec_time > 0 '; |
|
69 | + ' AND exec_time > 0 '; |
|
70 | 70 | $limit = 1; |
71 | 71 | $groupby = ''; |
72 | 72 |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | $limit = 1; |
68 | 68 | $groupby = ''; |
69 | 69 | |
70 | - $res = $db->exec_SELECTgetRows('*', 'tx_crawler_queue', $where, $groupby, $orderby, $limit); |
|
70 | + $res = $db->exec_SELECTgetRows('*', 'tx_crawler_queue', $where, $groupby, $orderby, $limit); |
|
71 | 71 | if ($res) { |
72 | - $first = $res[0]; |
|
72 | + $first = $res[0]; |
|
73 | 73 | } else { |
74 | 74 | $first = []; |
75 | 75 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | $db = $this->getDB(); |
145 | 145 | $rs = $db->exec_SELECTquery('count(*) as anz', $this->tableName, $where); |
146 | - $res = $db->sql_fetch_assoc($rs); |
|
146 | + $res = $db->sql_fetch_assoc($rs); |
|
147 | 147 | |
148 | 148 | return $res['anz']; |
149 | 149 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $res = $db->exec_SELECTquery( |
213 | 213 | 'configuration, count(*) as c', |
214 | 214 | $this->tableName, |
215 | - 'set_id in ('. implode(',', $setIds).') AND scheduled < '.time(), |
|
215 | + 'set_id in ('.implode(',', $setIds).') AND scheduled < '.time(), |
|
216 | 216 | 'configuration' |
217 | 217 | ); |
218 | 218 | while ($row = $db->sql_fetch_assoc($res)) { |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * @author Fabrizio Branca <[email protected]> |
259 | 259 | * @since 2010-11-16 |
260 | 260 | */ |
261 | - public function getLastProcessedEntries($selectFields='*', $limit='100') |
|
261 | + public function getLastProcessedEntries($selectFields = '*', $limit = '100') |
|
262 | 262 | { |
263 | 263 | $db = $this->getDB(); |
264 | 264 | $res = $db->exec_SELECTquery( |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $res = $db->exec_SELECTquery( |
293 | 293 | 'process_id_completed, min(exec_time) as start, max(exec_time) as end, count(*) as urlcount', |
294 | 294 | $this->tableName, |
295 | - 'exec_time != 0 and exec_time >= '.intval($start). ' and exec_time <= ' . intval($end), |
|
295 | + 'exec_time != 0 and exec_time >= '.intval($start).' and exec_time <= '.intval($end), |
|
296 | 296 | 'process_id_completed' |
297 | 297 | ); |
298 | 298 |
@@ -717,6 +717,7 @@ discard block |
||
717 | 717 | * @param array Page row or set-id |
718 | 718 | * @param string Title string |
719 | 719 | * @param int Items per Page setting |
720 | + * @param string $titleString |
|
720 | 721 | * @return string HTML <tr> content (one or more) |
721 | 722 | */ |
722 | 723 | public function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) |
@@ -1239,6 +1240,8 @@ discard block |
||
1239 | 1240 | * @param string Selector box name |
1240 | 1241 | * @param string Selector box value (array for multiple...) |
1241 | 1242 | * @param boolean If set, will draw multiple box. |
1243 | + * @param string $name |
|
1244 | + * @param integer $multiple |
|
1242 | 1245 | * @return string HTML select element |
1243 | 1246 | */ |
1244 | 1247 | public function selectorBox($optArray, $name, $value, $multiple) |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | |
202 | 202 | // Additional menus for the log type: |
203 | - if ($this->pObj->MOD_SETTINGS['crawlaction']==='log') { |
|
203 | + if ($this->pObj->MOD_SETTINGS['crawlaction'] === 'log') { |
|
204 | 204 | $h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
205 | 205 | $this->pObj->id, |
206 | 206 | 'SET[depth]', |
@@ -209,15 +209,15 @@ discard block |
||
209 | 209 | 'index.php' |
210 | 210 | ); |
211 | 211 | |
212 | - $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
212 | + $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
213 | 213 | |
214 | 214 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
215 | 215 | |
216 | - $h_func.= '<hr/>'. |
|
217 | - $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) . ' - ' . |
|
218 | - $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) . ' - ' . |
|
219 | - $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) . ' - ' . |
|
220 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' . |
|
216 | + $h_func .= '<hr/>'. |
|
217 | + $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).' - '. |
|
218 | + $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).' - '. |
|
219 | + $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).' - '. |
|
220 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': '. |
|
221 | 221 | \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
222 | 222 | $this->pObj->id, |
223 | 223 | 'SET[itemsPerPage]', |
@@ -227,11 +227,11 @@ discard block |
||
227 | 227 | ); |
228 | 228 | } |
229 | 229 | |
230 | - $theOutput= $this->pObj->doc->spacer(5); |
|
231 | - $theOutput.= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); |
|
230 | + $theOutput = $this->pObj->doc->spacer(5); |
|
231 | + $theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); |
|
232 | 232 | |
233 | 233 | // Branch based on type: |
234 | - switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) { |
|
234 | + switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) { |
|
235 | 235 | case 'start': |
236 | 236 | if (empty($this->pObj->id)) { |
237 | 237 | $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected')); |
@@ -289,12 +289,12 @@ discard block |
||
289 | 289 | $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download'); |
290 | 290 | $this->makeCrawlerProcessableChecks(); |
291 | 291 | |
292 | - switch ((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
292 | + switch ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
293 | 293 | case 'midnight': |
294 | 294 | $this->scheduledTime = mktime(0, 0, 0); |
295 | 295 | break; |
296 | 296 | case '04:00': |
297 | - $this->scheduledTime = mktime(0, 0, 0)+4*3600; |
|
297 | + $this->scheduledTime = mktime(0, 0, 0) + 4 * 3600; |
|
298 | 298 | break; |
299 | 299 | case 'now': |
300 | 300 | default: |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime()); |
315 | 315 | |
316 | 316 | if (empty($this->incomingConfigurationSelection) |
317 | - || (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0])) |
|
317 | + || (count($this->incomingConfigurationSelection) == 1 && empty($this->incomingConfigurationSelection[0])) |
|
318 | 318 | ) { |
319 | - $code= ' |
|
319 | + $code = ' |
|
320 | 320 | <tr> |
321 | 321 | <td colspan="7"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td> |
322 | 322 | </tr>'; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | tx_crawler_domain_events_dispatcher::getInstance()->post( |
334 | 334 | 'invokeQueueChange', |
335 | 335 | $this->findCrawler()->setID, |
336 | - [ 'reason' => $reason ] |
|
336 | + ['reason' => $reason] |
|
337 | 337 | ); |
338 | 338 | } |
339 | 339 | |
@@ -417,11 +417,11 @@ discard block |
||
417 | 417 | $this->pObj->MOD_SETTINGS['depth'], |
418 | 418 | 0 |
419 | 419 | ); |
420 | - $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0); |
|
420 | + $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'] ? $this->pObj->MOD_SETTINGS['depth'] : 0); |
|
421 | 421 | |
422 | 422 | // Configurations |
423 | 423 | $cell[] = $this->selectorBox( |
424 | - empty($availableConfigurations)?[]:array_combine($availableConfigurations, $availableConfigurations), |
|
424 | + empty($availableConfigurations) ? [] : array_combine($availableConfigurations, $availableConfigurations), |
|
425 | 425 | 'configurationSelection', |
426 | 426 | $this->incomingConfigurationSelection, |
427 | 427 | 1 |
@@ -561,12 +561,12 @@ discard block |
||
561 | 561 | // Print rudimentary details: |
562 | 562 | $output .= ' |
563 | 563 | <br /><br /> |
564 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" /> |
|
565 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
566 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
564 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back').'" name="_back" /> |
|
565 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
566 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
567 | 567 | <br /> |
568 | - Current server time: ' . date('H:i:s', time()) . '<br />' . |
|
569 | - 'Status: ' . $resStatus . '<br />' . |
|
568 | + Current server time: ' . date('H:i:s', time()).'<br />'. |
|
569 | + 'Status: '.$resStatus.'<br />'. |
|
570 | 570 | \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
571 | 571 | } else { // Show list: |
572 | 572 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | foreach ($tree->tree as $data) { |
597 | 597 | $code .= $this->drawLog_addRows( |
598 | 598 | $data['row'], |
599 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true), |
|
599 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true), |
|
600 | 600 | intval($this->pObj->MOD_SETTINGS['itemsPerPage']) |
601 | 601 | ); |
602 | 602 | if (++$count == 1000) { |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | } |
606 | 606 | } else { |
607 | 607 | $code = ''; |
608 | - $code.= $this->drawLog_addRows( |
|
608 | + $code .= $this->drawLog_addRows( |
|
609 | 609 | $showSetId, |
610 | 610 | 'Set ID: '.$showSetId |
611 | 611 | ); |
@@ -647,10 +647,10 @@ discard block |
||
647 | 647 | </tr> |
648 | 648 | '; |
649 | 649 | |
650 | - $cc=0; |
|
650 | + $cc = 0; |
|
651 | 651 | foreach ($setList as $set) { |
652 | - $code.= ' |
|
653 | - <tr class="bgColor'.($cc%2 ? '-20':'-10').'"> |
|
652 | + $code .= ' |
|
653 | + <tr class="bgColor'.($cc % 2 ? '-20' : '-10').'"> |
|
654 | 654 | <td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td> |
655 | 655 | <td>'.$set['count_value'].'</td> |
656 | 656 | <td>'.\TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td> |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | * @param int Items per Page setting |
720 | 720 | * @return string HTML <tr> content (one or more) |
721 | 721 | */ |
722 | - public function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) |
|
722 | + public function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage = 10) |
|
723 | 723 | { |
724 | 724 | |
725 | 725 | // If Flush button is pressed, flush tables instead of selecting entries: |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | if (count($res)) { |
751 | 751 | // Traverse parameter combinations: |
752 | 752 | $c = 0; |
753 | - $content=''; |
|
753 | + $content = ''; |
|
754 | 754 | foreach ($res as $kk => $vv) { |
755 | 755 | |
756 | 756 | // Title column: |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
775 | 775 | $rowData['result_log'] = $resLog; |
776 | 776 | } else { |
777 | - $rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
777 | + $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
778 | 778 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
779 | 779 | } |
780 | 780 | $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus, 50); |
@@ -791,27 +791,27 @@ discard block |
||
791 | 791 | |
792 | 792 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
793 | 793 | |
794 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif'; |
|
794 | + $refreshIcon = $GLOBALS['BACK_PATH'].'gfx/refresh_n.gif'; |
|
795 | 795 | if (version_compare(TYPO3_version, '7.0', '>=')) { |
796 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
796 | + $refreshIcon = $GLOBALS['BACK_PATH'].'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
797 | 797 | } |
798 | 798 | |
799 | 799 | // Put rows together: |
800 | - $content.= ' |
|
801 | - <tr class="bgColor'.($c%2 ? '-20':'-10').'"> |
|
800 | + $content .= ' |
|
801 | + <tr class="bgColor'.($c % 2 ? '-20' : '-10').'"> |
|
802 | 802 | '.$titleClm.' |
803 | - <td><a href="' . $this->getModuleUrl(['qid_details' => $vv['qid'], 'setID' => $setId]) . '">'.htmlspecialchars($vv['qid']).'</a></td> |
|
804 | - <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>'; |
|
803 | + <td><a href="' . $this->getModuleUrl(['qid_details' => $vv['qid'], 'setID' => $setId]).'">'.htmlspecialchars($vv['qid']).'</a></td> |
|
804 | + <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>'; |
|
805 | 805 | foreach ($rowData as $fKey => $value) { |
806 | 806 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) { |
807 | - $content.= ' |
|
807 | + $content .= ' |
|
808 | 808 | <td>'.$value.'</td>'; |
809 | 809 | } else { |
810 | - $content.= ' |
|
810 | + $content .= ' |
|
811 | 811 | <td>'.nl2br(htmlspecialchars($value)).'</td>'; |
812 | 812 | } |
813 | 813 | } |
814 | - $content.= ' |
|
814 | + $content .= ' |
|
815 | 815 | </tr>'; |
816 | 816 | $c++; |
817 | 817 | |
@@ -967,11 +967,11 @@ discard block |
||
967 | 967 | $this->addErrorMessage($e->getMessage()); |
968 | 968 | } |
969 | 969 | |
970 | - $offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset')); |
|
971 | - $perpage = 20; |
|
970 | + $offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset')); |
|
971 | + $perpage = 20; |
|
972 | 972 | |
973 | - $processRepository = new tx_crawler_domain_process_repository(); |
|
974 | - $queueRepository = new tx_crawler_domain_queue_repository(); |
|
973 | + $processRepository = new tx_crawler_domain_process_repository(); |
|
974 | + $queueRepository = new tx_crawler_domain_queue_repository(); |
|
975 | 975 | |
976 | 976 | $mode = $this->pObj->MOD_SETTINGS['processListMode']; |
977 | 977 | if ($mode == 'detail') { |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | $where = 'active = 1'; |
981 | 981 | } |
982 | 982 | |
983 | - $allProcesses = $processRepository->findAll('ttl', 'DESC', $perpage, $offset, $where); |
|
983 | + $allProcesses = $processRepository->findAll('ttl', 'DESC', $perpage, $offset, $where); |
|
984 | 984 | $allCount = $processRepository->countAll($where); |
985 | 985 | |
986 | 986 | $listView = new tx_crawler_view_process_list(); |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | $listView->setMaxActiveProcessCount(tx_crawler_api::forceIntegerInRange($this->extensionSettings['processLimit'], 1, 99, 1)); |
996 | 996 | $listView->setMode($mode); |
997 | 997 | |
998 | - $paginationView = new tx_crawler_view_pagination(); |
|
998 | + $paginationView = new tx_crawler_view_pagination(); |
|
999 | 999 | $paginationView->setCurrentOffset($offset); |
1000 | 1000 | $paginationView->setPerPage($perpage); |
1001 | 1001 | $paginationView->setTotalItemCount($allCount); |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | |
1034 | 1034 | $exitCode = 0; |
1035 | 1035 | $out = []; |
1036 | - exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode); |
|
1036 | + exec(escapeshellcmd($this->extensionSettings['phpPath'].' -v'), $out, $exitCode); |
|
1037 | 1037 | if ($exitCode > 0) { |
1038 | 1038 | $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath']))); |
1039 | 1039 | } |
@@ -1246,10 +1246,10 @@ discard block |
||
1246 | 1246 | $options = []; |
1247 | 1247 | foreach ($optArray as $key => $val) { |
1248 | 1248 | $options[] = ' |
1249 | - <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>'; |
|
1249 | + <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array) $value)) ? ' selected="selected"' : '').'>'.htmlspecialchars($val).'</option>'; |
|
1250 | 1250 | } |
1251 | 1251 | |
1252 | - $output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>'; |
|
1252 | + $output = '<select name="'.htmlspecialchars($name.($multiple ? '[]' : '')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>'; |
|
1253 | 1253 | |
1254 | 1254 | return $output; |
1255 | 1255 | } |
@@ -116,6 +116,7 @@ discard block |
||
116 | 116 | * Set the page id |
117 | 117 | * |
118 | 118 | * @param int page id |
119 | + * @param integer $pageId |
|
119 | 120 | */ |
120 | 121 | public function setPageId($pageId) |
121 | 122 | { |
@@ -293,7 +294,7 @@ discard block |
||
293 | 294 | * Converts seconds into minutes |
294 | 295 | * |
295 | 296 | * @param int $seconds |
296 | - * @return int |
|
297 | + * @return double |
|
297 | 298 | */ |
298 | 299 | protected function asMinutes($seconds) |
299 | 300 | { |
@@ -444,7 +445,7 @@ discard block |
||
444 | 445 | * just a wrapper should be done in a cleaner way |
445 | 446 | * later on |
446 | 447 | * |
447 | - * @param $label |
|
448 | + * @param string $label |
|
448 | 449 | * @return string |
449 | 450 | */ |
450 | 451 | protected function getLLLabel($label) |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | */ |
344 | 344 | protected function getRefreshLink() |
345 | 345 | { |
346 | - return '<input onclick="window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess&id=' . $this->pageId . '\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_refresh.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh') . '" />'; |
|
346 | + return '<input onclick="window.location=\''.\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info').'&SET[crawlaction]=multiprocess&id='.$this->pageId.'\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'arrow_refresh.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh').'" />'; |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | protected function getEnableDisableLink() |
365 | 365 | { |
366 | 366 | if ($this->getIsCrawlerEnabled()) { |
367 | - return '<input onclick="window.location+=\'&action=stopCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_stop_blue.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.disablecrawling') . '" />'; |
|
367 | + return '<input onclick="window.location+=\'&action=stopCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'control_stop_blue.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.disablecrawling').'" />'; |
|
368 | 368 | } else { |
369 | - return '<input onclick="window.location+=\'&action=resumeCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'control_play.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.enablecrawling') . '" />'; |
|
369 | + return '<input onclick="window.location+=\'&action=resumeCrawling\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'control_play.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.enablecrawling').'" />'; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | |
@@ -379,9 +379,9 @@ discard block |
||
379 | 379 | protected function getModeLink() |
380 | 380 | { |
381 | 381 | if ($this->getMode() == 'detail') { |
382 | - return '<input onclick="window.location+=\'&SET[processListMode]=simple\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_in.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.running') . '" />'; |
|
382 | + return '<input onclick="window.location+=\'&SET[processListMode]=simple\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'arrow_in.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.running').'" />'; |
|
383 | 383 | } elseif ($this->getMode() == 'simple') { |
384 | - return '<input onclick="window.location+=\'&SET[processListMode]=detail\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'arrow_out.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.all') . '" />'; |
|
384 | + return '<input onclick="window.location+=\'&SET[processListMode]=detail\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'arrow_out.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.show.all').'" />'; |
|
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | protected function getAddLink() |
395 | 395 | { |
396 | 396 | if ($this->getActiveProcessCount() < $this->getMaxActiveProcessCount() && $this->getIsCrawlerEnabled()) { |
397 | - return '<input onclick="window.location+=\'&action=addProcess\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\'' . $this->getIconPath() . 'add.png' . '\'); background-repeat: no-repeat;" value="' . $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.add') . '" />'; |
|
397 | + return '<input onclick="window.location+=\'&action=addProcess\';" type="button" style="padding:4px 4px 4px 20px; background-position: 3px 3px; background-image: url(\''.$this->getIconPath().'add.png'.'\'); background-repeat: no-repeat;" value="'.$this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.process.add').'" />'; |
|
398 | 398 | } else { |
399 | 399 | return ''; |
400 | 400 | } |
@@ -416,12 +416,12 @@ discard block |
||
416 | 416 | * @param string $icon |
417 | 417 | * @return string html tag for icon |
418 | 418 | */ |
419 | - protected function getIcon($icon, $title='') |
|
419 | + protected function getIcon($icon, $title = '') |
|
420 | 420 | { |
421 | 421 | if (!empty($title)) { |
422 | 422 | $title = ' title="'.$title.'"'; |
423 | 423 | } |
424 | - return '<img src="'.$this->getIconPath().$icon.'.png" ' . $title . ' />'; |
|
424 | + return '<img src="'.$this->getIconPath().$icon.'.png" '.$title.' />'; |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | /** |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | if (!isAbsPath($tempPathThisScript)) { |
13 | 13 | $workingDirectory = $_SERVER['PWD'] ? $_SERVER['PWD'] : getcwd(); |
14 | 14 | if ($workingDirectory) { |
15 | - $tempPathThisScript = $workingDirectory . '/' . preg_replace('/\.\//', '', $tempPathThisScript); |
|
15 | + $tempPathThisScript = $workingDirectory.'/'.preg_replace('/\.\//', '', $tempPathThisScript); |
|
16 | 16 | if (!@is_file($tempPathThisScript)) { |
17 | - die('Relative path found, but an error occured during resolving of the absolute path: ' . $tempPathThisScript . PHP_EOL); |
|
17 | + die('Relative path found, but an error occured during resolving of the absolute path: '.$tempPathThisScript.PHP_EOL); |
|
18 | 18 | } |
19 | 19 | } else { |
20 | - die('Relative path found, but resolving absolute path is not supported on this platform.' . PHP_EOL); |
|
20 | + die('Relative path found, but resolving absolute path is not supported on this platform.'.PHP_EOL); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | list($key, $value) = explode(':', $additionalHeader, 2); |
36 | 36 | $key = str_replace('-', '_', strtoupper(trim($key))); |
37 | 37 | if ($key != 'HOST') { |
38 | - $_SERVER['HTTP_' . $key] = $value; |
|
38 | + $_SERVER['HTTP_'.$key] = $value; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
@@ -57,18 +57,18 @@ discard block |
||
57 | 57 | $typo3SitePath = $_SERVER['argv'][1]; |
58 | 58 | |
59 | 59 | // faking the environment |
60 | -$_SERVER['DOCUMENT_ROOT'] = preg_replace('#' . preg_quote($typo3SitePath, '#') . '$#', '', $typo3Root); |
|
60 | +$_SERVER['DOCUMENT_ROOT'] = preg_replace('#'.preg_quote($typo3SitePath, '#').'$#', '', $typo3Root); |
|
61 | 61 | $_SERVER['HTTP_USER_AGENT'] = 'CLI Mode'; |
62 | 62 | $_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'] = $urlParts['host']; |
63 | -$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $typo3SitePath . 'index.php'; |
|
64 | -$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'] = $typo3Root . 'index.php'; |
|
63 | +$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $typo3SitePath.'index.php'; |
|
64 | +$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'] = $typo3Root.'index.php'; |
|
65 | 65 | $_SERVER['QUERY_STRING'] = (isset($urlParts['query']) ? $urlParts['query'] : ''); |
66 | -$_SERVER['REQUEST_URI'] = $urlParts['path'] . (isset($urlParts['query']) ? '?' . $urlParts['query'] : ''); |
|
66 | +$_SERVER['REQUEST_URI'] = $urlParts['path'].(isset($urlParts['query']) ? '?'.$urlParts['query'] : ''); |
|
67 | 67 | $_SERVER['REQUEST_METHOD'] = 'GET'; |
68 | 68 | |
69 | 69 | // Define a port if used in the URL: |
70 | 70 | if (isset($urlParts['port'])) { |
71 | - $_SERVER['HTTP_HOST'] .= ':' . $urlParts['port']; |
|
71 | + $_SERVER['HTTP_HOST'] .= ':'.$urlParts['port']; |
|
72 | 72 | $_SERVER['SERVER_PORT'] = $urlParts['port']; |
73 | 73 | } |
74 | 74 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | chdir($typo3Root); |
81 | -include($typo3Root . '/index.php'); |
|
81 | +include($typo3Root.'/index.php'); |
|
82 | 82 | |
83 | 83 | |
84 | 84 | /** |
@@ -49,11 +49,11 @@ |
||
49 | 49 | |
50 | 50 | // Adding options to help archive: |
51 | 51 | /** |
52 | - * We removed the "proc" option as it seemd not to be working any more. But as the complete handling of the crawler has changed regarding the configuration |
|
53 | - * this is completely ok. Since configuration records were introduced to configure "what should be done" additionally to page ts the way to setup jobs |
|
54 | - * has drifted from selecting filtering processing instructions to selecting/filtering configuration keys (you can configure the processing instructions there). |
|
55 | - * This is also reflected in the backend modules and allows you a much clearer and powerful way to work with the crawler extension. |
|
56 | - */ |
|
52 | + * We removed the "proc" option as it seemd not to be working any more. But as the complete handling of the crawler has changed regarding the configuration |
|
53 | + * this is completely ok. Since configuration records were introduced to configure "what should be done" additionally to page ts the way to setup jobs |
|
54 | + * has drifted from selecting filtering processing instructions to selecting/filtering configuration keys (you can configure the processing instructions there). |
|
55 | + * This is also reflected in the backend modules and allows you a much clearer and powerful way to work with the crawler extension. |
|
56 | + */ |
|
57 | 57 | // $this->cli_options[] = array('-proc listOfProcInstr', 'Comma list of processing instructions. These are the "actions" carried out when crawling and you must specify at least one. Depends on third-party extensions. Examples are "tx_cachemgm_recache" from "cachemgm" extension (will recache pages), "tx_staticpub_publish" from "staticpub" (publishing pages to static files) or "tx_indexedsearch_reindex" from "indexed_search" (indexes pages).'); |
58 | 58 | // TODO: cleanup here! |
59 | 59 | $this->cli_options[] = ['-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include."]; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->cli_options[] = ['-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include."]; |
60 | 60 | $this->cli_options[] = ['-o mode', 'Output mode: "url", "exec", "queue"', "Specifies output modes\nurl : Will list URLs which wget could use as input.\nqueue: Will put entries in queue table.\nexec: Will execute all entries right away!"]; |
61 | 61 | $this->cli_options[] = ['-n number', 'Number of items per minute.', 'Specifies how many items are put in the queue per minute. Only valid for output mode "queue"']; |
62 | - $this->cli_options[] = ['-conf configurationkeys','List of Configuration Keys','A commaseperated list of crawler configurations']; |
|
62 | + $this->cli_options[] = ['-conf configurationkeys', 'List of Configuration Keys', 'A commaseperated list of crawler configurations']; |
|
63 | 63 | # $this->cli_options[] = array('-v level', 'Verbosity level 0-3', "The value of level can be:\n 0 = all output\n 1 = info and greater (default)\n 2 = warnings and greater\n 3 = errors"); |
64 | 64 | |
65 | 65 | // Setting help texts: |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $this->cli_help['synopsis'] = 'page_id ###OPTIONS###'; |
68 | 68 | $this->cli_help['description'] = "Works as a CLI interface to some functionality from the Web > Info > Site Crawler module; It can put entries in the queue from command line options, return the list of URLs and even execute all entries right away without having to queue them up - this can be useful for immediate re-cache, re-indexing or static publishing from command line."; |
69 | 69 | $this->cli_help['examples'] = "/.../cli_dispatch.phpsh crawler_im 7 -d=2 -conf=<configurationKey> -o=exec\nWill re-cache pages from page 7 and two levels down, executed immediately.\n"; |
70 | - $this->cli_help['examples'].= "/.../cli_dispatch.phpsh crawler_im 7 -d=0 -conf=<configurationKey> -n=4 -o=queue\nWill put entries for re-caching pages from page 7 into queue, 4 every minute.\n"; |
|
70 | + $this->cli_help['examples'] .= "/.../cli_dispatch.phpsh crawler_im 7 -d=0 -conf=<configurationKey> -n=4 -o=queue\nWill put entries for re-caching pages from page 7 into queue, 4 every minute.\n"; |
|
71 | 71 | $this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2009'; |
72 | 72 | } |
73 | 73 | } |
@@ -9,5 +9,5 @@ |
||
9 | 9 | try { |
10 | 10 | $processManager->multiProcess($timeout); |
11 | 11 | } catch (Exception $e) { |
12 | - echo PHP_EOL . $e->getMessage(); |
|
12 | + echo PHP_EOL.$e->getMessage(); |
|
13 | 13 | } |