@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return array Menu array |
92 | 92 | */ |
93 | - function modMenu() { |
|
93 | + function modMenu() { |
|
94 | 94 | global $LANG; |
95 | 95 | |
96 | - return array ( |
|
96 | + return array( |
|
97 | 97 | 'depth' => array( |
98 | 98 | 0 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'), |
99 | 99 | 1 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'), |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | // Set CSS styles specific for this document: |
153 | - $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/',' |
|
153 | + $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', ' |
|
154 | 154 | TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } |
155 | 155 | ',$this->pObj->content); |
156 | 156 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | |
197 | 197 | // Additional menus for the log type: |
198 | - if ($this->pObj->MOD_SETTINGS['crawlaction']==='log') { |
|
198 | + if ($this->pObj->MOD_SETTINGS['crawlaction'] === 'log') { |
|
199 | 199 | $h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
200 | 200 | $this->pObj->id, |
201 | 201 | 'SET[depth]', |
@@ -204,15 +204,15 @@ discard block |
||
204 | 204 | 'index.php' |
205 | 205 | ); |
206 | 206 | |
207 | - $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
207 | + $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
208 | 208 | |
209 | 209 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
210 | 210 | |
211 | - $h_func.= '<hr/>'. |
|
212 | - $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) . ' - ' . |
|
213 | - $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) . ' - ' . |
|
214 | - $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) . ' - ' . |
|
215 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': ' . |
|
211 | + $h_func .= '<hr/>'. |
|
212 | + $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).' - '. |
|
213 | + $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).' - '. |
|
214 | + $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).' - '. |
|
215 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage').': '. |
|
216 | 216 | \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
217 | 217 | $this->pObj->id, |
218 | 218 | 'SET[itemsPerPage]', |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | - $theOutput= $this->pObj->doc->spacer(5); |
|
226 | - $theOutput.= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); |
|
225 | + $theOutput = $this->pObj->doc->spacer(5); |
|
226 | + $theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); |
|
227 | 227 | |
228 | 228 | // Branch based on type: |
229 | - switch ((string)$this->pObj->MOD_SETTINGS['crawlaction']) { |
|
229 | + switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) { |
|
230 | 230 | case 'start': |
231 | 231 | if (empty($this->pObj->id)) { |
232 | 232 | $this->addErrorMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected')); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * |
275 | 275 | * @return string HTML output |
276 | 276 | */ |
277 | - function drawURLs() { |
|
277 | + function drawURLs() { |
|
278 | 278 | global $BACK_PATH, $BE_USER; |
279 | 279 | |
280 | 280 | // Init: |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download'); |
284 | 284 | $this->makeCrawlerProcessableChecks(); |
285 | 285 | |
286 | - switch((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
286 | + switch ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
287 | 287 | case 'midnight': |
288 | - $this->scheduledTime = mktime(0,0,0); |
|
288 | + $this->scheduledTime = mktime(0, 0, 0); |
|
289 | 289 | break; |
290 | 290 | case '04:00': |
291 | - $this->scheduledTime = mktime(0,0,0)+4*3600; |
|
291 | + $this->scheduledTime = mktime(0, 0, 0) + 4 * 3600; |
|
292 | 292 | break; |
293 | 293 | case 'now': |
294 | 294 | default: |
@@ -308,23 +308,23 @@ discard block |
||
308 | 308 | $this->crawlerObj->setID = \TYPO3\CMS\Core\Utility\GeneralUtility::md5int(microtime()); |
309 | 309 | |
310 | 310 | if (empty($this->incomingConfigurationSelection) |
311 | - || (count($this->incomingConfigurationSelection)==1 && empty($this->incomingConfigurationSelection[0])) |
|
311 | + || (count($this->incomingConfigurationSelection) == 1 && empty($this->incomingConfigurationSelection[0])) |
|
312 | 312 | ) { |
313 | - $code= ' |
|
313 | + $code = ' |
|
314 | 314 | <tr> |
315 | 315 | <td colspan="7"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td> |
316 | 316 | </tr>'; |
317 | 317 | } else { |
318 | - if($this->submitCrawlUrls){ |
|
318 | + if ($this->submitCrawlUrls) { |
|
319 | 319 | $reason = new tx_crawler_domain_reason(); |
320 | 320 | $reason->setReason(tx_crawler_domain_reason::REASON_GUI_SUBMIT); |
321 | 321 | |
322 | - if($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication){ $username = $BE_USER->user['username']; } |
|
322 | + if ($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication) { $username = $BE_USER->user['username']; } |
|
323 | 323 | $reason->setDetailText('The user '.$username.' added pages to the crawler queue manually '); |
324 | 324 | |
325 | - tx_crawler_domain_events_dispatcher::getInstance()->post( 'invokeQueueChange', |
|
325 | + tx_crawler_domain_events_dispatcher::getInstance()->post('invokeQueueChange', |
|
326 | 326 | $this->findCrawler()->setID, |
327 | - array( 'reason' => $reason )); |
|
327 | + array('reason' => $reason)); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | $code = $this->crawlerObj->getPageTreeAndUrls( |
@@ -345,18 +345,18 @@ discard block |
||
345 | 345 | $this->duplicateTrack = $this->crawlerObj->duplicateTrack; |
346 | 346 | |
347 | 347 | $output = ''; |
348 | - if ($code) { |
|
348 | + if ($code) { |
|
349 | 349 | |
350 | 350 | $output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>'; |
351 | 351 | $output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />'; |
352 | 352 | |
353 | - if (!$this->submitCrawlUrls) { |
|
353 | + if (!$this->submitCrawlUrls) { |
|
354 | 354 | $output .= $this->drawURLs_cfgSelectors().'<br />'; |
355 | 355 | $output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> '; |
356 | 356 | $output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> '; |
357 | 357 | $output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />'; |
358 | 358 | $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />'; |
359 | - $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).'<br />'; |
|
359 | + $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).'<br />'; |
|
360 | 360 | $output .= '<br /> |
361 | 361 | <table class="lrPadding c-list url-table">'. |
362 | 362 | $this->drawURLs_printTableHeader(). |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | // Download Urls to crawl: |
373 | - if ($this->downloadCrawlUrls) { |
|
373 | + if ($this->downloadCrawlUrls) { |
|
374 | 374 | |
375 | 375 | // Creating output header: |
376 | 376 | $mimeType = 'application/octet-stream'; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | Header('Content-Disposition: attachment; filename=CrawlerUrls.txt'); |
379 | 379 | |
380 | 380 | // Printing the content of the CSV lines: |
381 | - echo implode(chr(13).chr(10),$this->downloadUrls); |
|
381 | + echo implode(chr(13).chr(10), $this->downloadUrls); |
|
382 | 382 | |
383 | 383 | // Exits: |
384 | 384 | exit; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | * |
394 | 394 | * @return string HTML table |
395 | 395 | */ |
396 | - function drawURLs_cfgSelectors() { |
|
396 | + function drawURLs_cfgSelectors() { |
|
397 | 397 | |
398 | 398 | // depth |
399 | 399 | $cell[] = $this->selectorBox( |
@@ -409,11 +409,11 @@ discard block |
||
409 | 409 | $this->pObj->MOD_SETTINGS['depth'], |
410 | 410 | 0 |
411 | 411 | ); |
412 | - $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth']?$this->pObj->MOD_SETTINGS['depth']:0 ); |
|
412 | + $availableConfigurations = $this->crawlerObj->getConfigurationsForBranch($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'] ? $this->pObj->MOD_SETTINGS['depth'] : 0); |
|
413 | 413 | |
414 | 414 | // Configurations |
415 | 415 | $cell[] = $this->selectorBox( |
416 | - empty($availableConfigurations)?array():array_combine($availableConfigurations, $availableConfigurations), |
|
416 | + empty($availableConfigurations) ? array() : array_combine($availableConfigurations, $availableConfigurations), |
|
417 | 417 | 'configurationSelection', |
418 | 418 | $this->incomingConfigurationSelection, |
419 | 419 | 1 |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | * |
475 | 475 | * @return string Table header |
476 | 476 | */ |
477 | - function drawURLs_printTableHeader() { |
|
477 | + function drawURLs_printTableHeader() { |
|
478 | 478 | |
479 | 479 | $content = ' |
480 | 480 | <tr class="bgColor5 tableheader"> |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | * |
513 | 513 | * @return string HTML output |
514 | 514 | */ |
515 | - function drawLog() { |
|
515 | + function drawLog() { |
|
516 | 516 | global $BACK_PATH; |
517 | 517 | $output = ''; |
518 | 518 | |
@@ -524,46 +524,46 @@ discard block |
||
524 | 524 | $this->CSVExport = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_csv'); |
525 | 525 | |
526 | 526 | // Read URL: |
527 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')) { |
|
528 | - $this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')),TRUE); |
|
527 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')) { |
|
528 | + $this->crawlerObj->readUrl(intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_read')), TRUE); |
|
529 | 529 | } |
530 | 530 | |
531 | 531 | // Look for set ID sent - if it is, we will display contents of that set: |
532 | 532 | $showSetId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
533 | 533 | |
534 | 534 | // Show details: |
535 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) { |
|
535 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) { |
|
536 | 536 | |
537 | 537 | // Get entry record: |
538 | - list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_crawler_queue','qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
538 | + list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
539 | 539 | |
540 | 540 | // Explode values: |
541 | 541 | $resStatus = $this->getResStatus($q_entry); |
542 | 542 | $q_entry['parameters'] = unserialize($q_entry['parameters']); |
543 | 543 | $q_entry['result_data'] = unserialize($q_entry['result_data']); |
544 | - if (is_array($q_entry['result_data'])) { |
|
544 | + if (is_array($q_entry['result_data'])) { |
|
545 | 545 | $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']); |
546 | 546 | } |
547 | 547 | |
548 | - if(!$this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
548 | + if (!$this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
549 | 549 | unset($q_entry['result_data']['content']['log']); |
550 | 550 | } |
551 | 551 | |
552 | 552 | // Print rudimentary details: |
553 | 553 | $output .= ' |
554 | 554 | <br /><br /> |
555 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" /> |
|
556 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
557 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
555 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back').'" name="_back" /> |
|
556 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
557 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
558 | 558 | <br /> |
559 | - Current server time: ' . date('H:i:s', time()) . '<br />' . |
|
560 | - 'Status: ' . $resStatus . '<br />' . |
|
559 | + Current server time: ' . date('H:i:s', time()).'<br />'. |
|
560 | + 'Status: '.$resStatus.'<br />'. |
|
561 | 561 | \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
562 | 562 | } else { // Show list: |
563 | 563 | |
564 | 564 | // If either id or set id, show list: |
565 | - if ($this->pObj->id || $showSetId) { |
|
566 | - if ($this->pObj->id) { |
|
565 | + if ($this->pObj->id || $showSetId) { |
|
566 | + if ($this->pObj->id) { |
|
567 | 567 | // Drawing tree: |
568 | 568 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
569 | 569 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
@@ -578,16 +578,16 @@ discard block |
||
578 | 578 | ); |
579 | 579 | |
580 | 580 | // Get branch beneath: |
581 | - if ($this->pObj->MOD_SETTINGS['depth']) { |
|
581 | + if ($this->pObj->MOD_SETTINGS['depth']) { |
|
582 | 582 | $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], ''); |
583 | 583 | } |
584 | 584 | |
585 | 585 | // Traverse page tree: |
586 | 586 | $code = ''; $count = 0; |
587 | - foreach($tree->tree as $data) { |
|
587 | + foreach ($tree->tree as $data) { |
|
588 | 588 | $code .= $this->drawLog_addRows( |
589 | 589 | $data['row'], |
590 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages',$data['row'],TRUE), |
|
590 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], TRUE), |
|
591 | 591 | intval($this->pObj->MOD_SETTINGS['itemsPerPage']) |
592 | 592 | ); |
593 | 593 | if (++$count == 1000) { |
@@ -596,13 +596,13 @@ discard block |
||
596 | 596 | } |
597 | 597 | } else { |
598 | 598 | $code = ''; |
599 | - $code.= $this->drawLog_addRows( |
|
599 | + $code .= $this->drawLog_addRows( |
|
600 | 600 | $showSetId, |
601 | 601 | 'Set ID: '.$showSetId |
602 | 602 | ); |
603 | 603 | } |
604 | 604 | |
605 | - if ($code) { |
|
605 | + if ($code) { |
|
606 | 606 | |
607 | 607 | $output .= ' |
608 | 608 | <br /><br /> |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | <input type="hidden" value="'.$this->pObj->id.'" name="id" /> |
614 | 614 | <input type="hidden" value="'.$showSetId.'" name="setID" /> |
615 | 615 | <br /> |
616 | - '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s',time()).' |
|
616 | + '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', time()).' |
|
617 | 617 | <br /><br /> |
618 | 618 | |
619 | 619 | |
@@ -639,10 +639,10 @@ discard block |
||
639 | 639 | </tr> |
640 | 640 | '; |
641 | 641 | |
642 | - $cc=0; |
|
643 | - foreach($setList as $set) { |
|
644 | - $code.= ' |
|
645 | - <tr class="bgColor'.($cc%2 ? '-20':'-10').'"> |
|
642 | + $cc = 0; |
|
643 | + foreach ($setList as $set) { |
|
644 | + $code .= ' |
|
645 | + <tr class="bgColor'.($cc % 2 ? '-20' : '-10').'"> |
|
646 | 646 | <td><a href="'.htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td> |
647 | 647 | <td>'.$set['count_value'].'</td> |
648 | 648 | <td>'.\TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td> |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | } |
661 | 661 | } |
662 | 662 | |
663 | - if($this->CSVExport) { |
|
663 | + if ($this->CSVExport) { |
|
664 | 664 | $this->outputCsvFile(); |
665 | 665 | } |
666 | 666 | |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($fieldNames); |
687 | 687 | |
688 | 688 | // Data: |
689 | - foreach($this->CSVaccu as $row) { |
|
689 | + foreach ($this->CSVaccu as $row) { |
|
690 | 690 | $csvLines[] = \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($row); |
691 | 691 | } |
692 | 692 | |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | Header('Content-Disposition: attachment; filename=CrawlerLog.csv'); |
697 | 697 | |
698 | 698 | // Printing the content of the CSV lines: |
699 | - echo implode(chr(13).chr(10),$csvLines); |
|
699 | + echo implode(chr(13).chr(10), $csvLines); |
|
700 | 700 | |
701 | 701 | // Exits: |
702 | 702 | exit; |
@@ -712,14 +712,14 @@ discard block |
||
712 | 712 | * |
713 | 713 | * @return string HTML <tr> content (one or more) |
714 | 714 | */ |
715 | - function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage=10) { |
|
715 | + function drawLog_addRows($pageRow_setId, $titleString, $itemsPerPage = 10) { |
|
716 | 716 | |
717 | 717 | // If Flush button is pressed, flush tables instead of selecting entries: |
718 | 718 | |
719 | - if(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) { |
|
719 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush')) { |
|
720 | 720 | $doFlush = true; |
721 | 721 | $doFullFlush = false; |
722 | - } elseif(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) { |
|
722 | + } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_flush_all')) { |
|
723 | 723 | $doFlush = true; |
724 | 724 | $doFullFlush = true; |
725 | 725 | } else { |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | } |
729 | 729 | |
730 | 730 | // Get result: |
731 | - if (is_array($pageRow_setId)) { |
|
731 | + if (is_array($pageRow_setId)) { |
|
732 | 732 | $res = $this->crawlerObj->getLogEntriesForPageId($pageRow_setId['uid'], $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage)); |
733 | 733 | } else { |
734 | 734 | $res = $this->crawlerObj->getLogEntriesForSetId($pageRow_setId, $this->pObj->MOD_SETTINGS['log_display'], $doFlush, $doFullFlush, intval($itemsPerPage)); |
@@ -739,14 +739,14 @@ discard block |
||
739 | 739 | + ($this->pObj->MOD_SETTINGS['log_resultLog'] ? -1 : 0) |
740 | 740 | + ($this->pObj->MOD_SETTINGS['log_feVars'] ? 3 : 0); |
741 | 741 | |
742 | - if (count($res)) { |
|
742 | + if (count($res)) { |
|
743 | 743 | // Traverse parameter combinations: |
744 | 744 | $c = 0; |
745 | - $content=''; |
|
746 | - foreach($res as $kk => $vv) { |
|
745 | + $content = ''; |
|
746 | + foreach ($res as $kk => $vv) { |
|
747 | 747 | |
748 | 748 | // Title column: |
749 | - if (!$c) { |
|
749 | + if (!$c) { |
|
750 | 750 | $titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>'; |
751 | 751 | } else { |
752 | 752 | $titleClm = ''; |
@@ -763,16 +763,16 @@ discard block |
||
763 | 763 | |
764 | 764 | // Put data into array: |
765 | 765 | $rowData = array(); |
766 | - if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
766 | + if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
767 | 767 | $rowData['result_log'] = $resLog; |
768 | 768 | } else { |
769 | - $rowData['scheduled'] = ($vv['scheduled']> 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
769 | + $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
770 | 770 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
771 | 771 | } |
772 | - $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus,50); |
|
772 | + $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus, 50); |
|
773 | 773 | $rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>'; |
774 | 774 | $rowData['feUserGroupList'] = $parameters['feUserGroupList']; |
775 | - $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ',$parameters['procInstructions']) : ''; |
|
775 | + $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ', $parameters['procInstructions']) : ''; |
|
776 | 776 | $rowData['set_id'] = $vv['set_id']; |
777 | 777 | |
778 | 778 | if ($this->pObj->MOD_SETTINGS['log_feVars']) { |
@@ -783,34 +783,34 @@ discard block |
||
783 | 783 | |
784 | 784 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
785 | 785 | |
786 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif'; |
|
787 | - if (version_compare(TYPO3_version,'7.0','>=')) { |
|
788 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
786 | + $refreshIcon = $GLOBALS['BACK_PATH'].'gfx/refresh_n.gif'; |
|
787 | + if (version_compare(TYPO3_version, '7.0', '>=')) { |
|
788 | + $refreshIcon = $GLOBALS['BACK_PATH'].'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | // Put rows together: |
792 | - $content.= ' |
|
793 | - <tr class="bgColor'.($c%2 ? '-20':'-10').'"> |
|
792 | + $content .= ' |
|
793 | + <tr class="bgColor'.($c % 2 ? '-20' : '-10').'"> |
|
794 | 794 | '.$titleClm.' |
795 | - <td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)) . '">'.htmlspecialchars($vv['qid']).'</a></td> |
|
796 | - <td><a href="' . $this->getModuleUrl(array('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>'; |
|
797 | - foreach($rowData as $fKey => $value) { |
|
795 | + <td><a href="' . $this->getModuleUrl(array('qid_details' => $vv['qid'], 'setID' => $setId)).'">'.htmlspecialchars($vv['qid']).'</a></td> |
|
796 | + <td><a href="' . $this->getModuleUrl(array('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>'; |
|
797 | + foreach ($rowData as $fKey => $value) { |
|
798 | 798 | |
799 | - if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url',$fKey)) { |
|
800 | - $content.= ' |
|
799 | + if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) { |
|
800 | + $content .= ' |
|
801 | 801 | <td>'.$value.'</td>'; |
802 | 802 | } else { |
803 | - $content.= ' |
|
803 | + $content .= ' |
|
804 | 804 | <td>'.nl2br(htmlspecialchars($value)).'</td>'; |
805 | 805 | } |
806 | 806 | } |
807 | - $content.= ' |
|
807 | + $content .= ' |
|
808 | 808 | </tr>'; |
809 | 809 | $c++; |
810 | 810 | |
811 | - if ($this->CSVExport) { |
|
811 | + if ($this->CSVExport) { |
|
812 | 812 | // Only for CSV (adding qid and scheduled/exec_time if needed): |
813 | - $rowData['result_log'] = implode('// ',explode(chr(10),$resLog)); |
|
813 | + $rowData['result_log'] = implode('// ', explode(chr(10), $resLog)); |
|
814 | 814 | $rowData['qid'] = $vv['qid']; |
815 | 815 | $rowData['scheduled'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']); |
816 | 816 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | * |
854 | 854 | * @return string Table header |
855 | 855 | */ |
856 | - function drawLog_printTableHeader() { |
|
856 | + function drawLog_printTableHeader() { |
|
857 | 857 | |
858 | 858 | $content = ' |
859 | 859 | <tr class="bgColor5 tableheader"> |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | } |
905 | 905 | |
906 | 906 | function getResStatus($vv) { |
907 | - if ($vv['result_data']) { |
|
907 | + if ($vv['result_data']) { |
|
908 | 908 | $requestContent = unserialize($vv['result_data']); |
909 | 909 | $requestResult = unserialize($requestContent['content']); |
910 | 910 | if (is_array($requestResult)) { |
@@ -913,9 +913,9 @@ discard block |
||
913 | 913 | } else { |
914 | 914 | $resStatus = implode("\n", $requestResult['errorlog']); |
915 | 915 | } |
916 | - $resLog = is_array($requestResult['log']) ? implode(chr(10),$requestResult['log']) : ''; |
|
916 | + $resLog = is_array($requestResult['log']) ? implode(chr(10), $requestResult['log']) : ''; |
|
917 | 917 | } else { |
918 | - $resStatus = 'Error: '.substr(preg_replace('/\s+/',' ',strip_tags($requestContent['content'])),0,10000).'...'; |
|
918 | + $resStatus = 'Error: '.substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, 10000).'...'; |
|
919 | 919 | } |
920 | 920 | } else { |
921 | 921 | $resStatus = '-'; |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | * @param void |
944 | 944 | * @return string |
945 | 945 | */ |
946 | - protected function drawProcessOverviewAction(){ |
|
946 | + protected function drawProcessOverviewAction() { |
|
947 | 947 | |
948 | 948 | $this->runRefreshHooks(); |
949 | 949 | |
@@ -957,20 +957,20 @@ discard block |
||
957 | 957 | $this->addErrorMessage($e->getMessage()); |
958 | 958 | } |
959 | 959 | |
960 | - $offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset')); |
|
961 | - $perpage = 20; |
|
960 | + $offset = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('offset')); |
|
961 | + $perpage = 20; |
|
962 | 962 | |
963 | - $processRepository = new tx_crawler_domain_process_repository(); |
|
964 | - $queueRepository = new tx_crawler_domain_queue_repository(); |
|
963 | + $processRepository = new tx_crawler_domain_process_repository(); |
|
964 | + $queueRepository = new tx_crawler_domain_queue_repository(); |
|
965 | 965 | |
966 | 966 | $mode = $this->pObj->MOD_SETTINGS['processListMode']; |
967 | 967 | if ($mode == 'detail') { |
968 | 968 | $where = ''; |
969 | - } elseif($mode == 'simple') { |
|
969 | + } elseif ($mode == 'simple') { |
|
970 | 970 | $where = 'active = 1'; |
971 | 971 | } |
972 | 972 | |
973 | - $allProcesses = $processRepository->findAll('ttl','DESC', $perpage, $offset,$where); |
|
973 | + $allProcesses = $processRepository->findAll('ttl', 'DESC', $perpage, $offset, $where); |
|
974 | 974 | $allCount = $processRepository->countAll($where); |
975 | 975 | |
976 | 976 | $listView = new tx_crawler_view_process_list(); |
@@ -982,10 +982,10 @@ discard block |
||
982 | 982 | $listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems()); |
983 | 983 | $listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems()); |
984 | 984 | $listView->setActiveProcessCount($processRepository->countActive()); |
985 | - $listView->setMaxActiveProcessCount(\TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['processLimit'],1,99,1)); |
|
985 | + $listView->setMaxActiveProcessCount(\TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->extensionSettings['processLimit'], 1, 99, 1)); |
|
986 | 986 | $listView->setMode($mode); |
987 | 987 | |
988 | - $paginationView = new tx_crawler_view_pagination(); |
|
988 | + $paginationView = new tx_crawler_view_pagination(); |
|
989 | 989 | $paginationView->setCurrentOffset($offset); |
990 | 990 | $paginationView->setPerPage($perpage); |
991 | 991 | $paginationView->setTotalItemCount($allCount); |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | |
1023 | 1023 | $exitCode = 0; |
1024 | 1024 | $out = array(); |
1025 | - exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode); |
|
1025 | + exec(escapeshellcmd($this->extensionSettings['phpPath'].' -v'), $out, $exitCode); |
|
1026 | 1026 | if ($exitCode > 0) { |
1027 | 1027 | $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), htmlspecialchars($this->extensionSettings['phpPath']))); |
1028 | 1028 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | * @param void |
1086 | 1086 | * @return void |
1087 | 1087 | */ |
1088 | - protected function handleProcessOverviewActions(){ |
|
1088 | + protected function handleProcessOverviewActions() { |
|
1089 | 1089 | |
1090 | 1090 | $crawler = $this->findCrawler(); |
1091 | 1091 | |
@@ -1118,8 +1118,8 @@ discard block |
||
1118 | 1118 | * @return tx_crawler_lib crawler object |
1119 | 1119 | * @author Timo Schmidt <[email protected]> |
1120 | 1120 | */ |
1121 | - protected function findCrawler(){ |
|
1122 | - if(!$this->crawlerObj instanceof tx_crawler_lib){ |
|
1121 | + protected function findCrawler() { |
|
1122 | + if (!$this->crawlerObj instanceof tx_crawler_lib) { |
|
1123 | 1123 | $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib'); |
1124 | 1124 | } |
1125 | 1125 | return $this->crawlerObj; |
@@ -1221,15 +1221,15 @@ discard block |
||
1221 | 1221 | * |
1222 | 1222 | * @return string HTML select element |
1223 | 1223 | */ |
1224 | - function selectorBox($optArray, $name, $value, $multiple) { |
|
1224 | + function selectorBox($optArray, $name, $value, $multiple) { |
|
1225 | 1225 | |
1226 | 1226 | $options = array(); |
1227 | - foreach($optArray as $key => $val) { |
|
1227 | + foreach ($optArray as $key => $val) { |
|
1228 | 1228 | $options[] = ' |
1229 | - <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value,$key)) || ($multiple && in_array($key,(array)$value))?' selected="selected"':'').'>'.htmlspecialchars($val).'</option>'; |
|
1229 | + <option value="'.htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, $key)) || ($multiple && in_array($key, (array) $value)) ? ' selected="selected"' : '').'>'.htmlspecialchars($val).'</option>'; |
|
1230 | 1230 | } |
1231 | 1231 | |
1232 | - $output = '<select name="'.htmlspecialchars($name.($multiple?'[]':'')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('',$options).'</select>'; |
|
1232 | + $output = '<select name="'.htmlspecialchars($name.($multiple ? '[]' : '')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', $options).'</select>'; |
|
1233 | 1233 | |
1234 | 1234 | return $output; |
1235 | 1235 | } |
@@ -1268,6 +1268,6 @@ discard block |
||
1268 | 1268 | } |
1269 | 1269 | } |
1270 | 1270 | |
1271 | -if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']) { |
|
1271 | +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']) { |
|
1272 | 1272 | include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/crawler/modfunc1/class.tx_crawler_modfunc1.php']); |
1273 | 1273 | } |
1274 | 1274 | \ No newline at end of file |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php if (!defined('TYPO3_MODE')) die ('Access denied.'); ?> |
2 | 2 | |
3 | 3 | Page: |
4 | -<?php for($currentPageOffset = 0; $currentPageOffset < $this->getTotalPagesCount(); $currentPageOffset++ ){ ?> |
|
4 | +<?php for ($currentPageOffset = 0; $currentPageOffset < $this->getTotalPagesCount(); $currentPageOffset++) { ?> |
|
5 | 5 | <a href="index.php?offset=<?php echo htmlspecialchars($currentPageOffset * $this->getPerPage()); ?>"> |
6 | 6 | <?php echo htmlspecialchars($this->getLabelForPageOffset($currentPageOffset)); ?> |
7 | 7 | </a> |
8 | - <?php if($currentPageOffset+1 < $this->getTotalPagesCount()){ ?> |
|
8 | + <?php if ($currentPageOffset + 1 < $this->getTotalPagesCount()) { ?> |
|
9 | 9 | | |
10 | 10 | <?php } ?> |
11 | 11 |
@@ -50,17 +50,17 @@ |
||
50 | 50 | </tr> |
51 | 51 | </thead> |
52 | 52 | <tbody> |
53 | - <?php foreach($this->getProcessCollection() as $process): /* @var $process tx_crawler_domain_process */ ?> |
|
54 | - <tr class="<?php echo (++$count % 2 == 0) ? 'odd': 'even' ?>"> |
|
53 | + <?php foreach ($this->getProcessCollection() as $process): /* @var $process tx_crawler_domain_process */ ?> |
|
54 | + <tr class="<?php echo (++$count % 2 == 0) ? 'odd' : 'even' ?>"> |
|
55 | 55 | <td><?php echo $this->getIconForState(htmlspecialchars($process->getState())); ?></td> |
56 | 56 | <td><?php echo htmlspecialchars($process->getProcess_id()); ?></td> |
57 | 57 | <td><?php echo htmlspecialchars($this->asDate($process->getTimeForFirstItem())); ?></td> |
58 | 58 | <td><?php echo htmlspecialchars($this->asDate($process->getTimeForLastItem())); ?></td> |
59 | - <td><?php echo htmlspecialchars(floor($process->getRuntime()/ 60)); ?> min. <?php echo htmlspecialchars($process->getRuntime()) % 60 ?> sec.</td> |
|
59 | + <td><?php echo htmlspecialchars(floor($process->getRuntime() / 60)); ?> min. <?php echo htmlspecialchars($process->getRuntime()) % 60 ?> sec.</td> |
|
60 | 60 | <td><?php echo htmlspecialchars($this->asDate($process->getTTL())); ?></td> |
61 | 61 | <td><?php echo htmlspecialchars($process->countItemsProcessed()); ?></td> |
62 | 62 | <td><?php echo htmlspecialchars($process->countItemsAssigned()); ?></td> |
63 | - <td><?php echo htmlspecialchars($process->countItemsToProcess()+$process->countItemsProcessed()); ?></td> |
|
63 | + <td><?php echo htmlspecialchars($process->countItemsToProcess() + $process->countItemsProcessed()); ?></td> |
|
64 | 64 | <td> |
65 | 65 | <?php if ($process->getState() == 'running'): ?> |
66 | 66 | <div class="crawlerprocessprogress" style="width: 200px;"> |
@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | 2 | $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler'); |
3 | 3 | return array( |
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 | ); |
@@ -4,10 +4,10 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | $processManager = new tx_crawler_domain_process_manager(); |
7 | -$timeout = isset($_SERVER['argv'][1] ) ? intval($_SERVER['argv'][1]) : 10000; |
|
7 | +$timeout = isset($_SERVER['argv'][1]) ? intval($_SERVER['argv'][1]) : 10000; |
|
8 | 8 | |
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 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->cli_options[] = array('-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include."); |
58 | 58 | $this->cli_options[] = array('-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!"); |
59 | 59 | $this->cli_options[] = array('-n number', 'Number of items per minute.', 'Specifies how many items are put in the queue per minute. Only valid for output mode "queue"'); |
60 | - $this->cli_options[] = array('-conf configurationkeys','List of Configuration Keys','A commaseperated list of crawler configurations'); |
|
60 | + $this->cli_options[] = array('-conf configurationkeys', 'List of Configuration Keys', 'A commaseperated list of crawler configurations'); |
|
61 | 61 | # $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"); |
62 | 62 | |
63 | 63 | // Setting help texts: |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $this->cli_help['synopsis'] = 'page_id ###OPTIONS###'; |
66 | 66 | $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."; |
67 | 67 | $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"; |
68 | - $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"; |
|
68 | + $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"; |
|
69 | 69 | $this->cli_help['author'] = 'Kasper Skaarhoj, Daniel Poetzinger, Fabrizio Branca, Tolleiv Nietsch, Timo Schmidt - AOE media 2009'; |
70 | 70 | } |
71 | 71 | } |
@@ -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,7 +49,7 @@ |
||
49 | 49 | * @param void |
50 | 50 | * @return string table name |
51 | 51 | */ |
52 | - public static function getTableName(){ |
|
52 | + public static function getTableName() { |
|
53 | 53 | return self::$tableName; |
54 | 54 | } |
55 | 55 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * |
35 | 35 | * @return int |
36 | 36 | */ |
37 | - public function getExecutionTime(){ |
|
37 | + public function getExecutionTime() { |
|
38 | 38 | return $this->row['exec_time']; |
39 | 39 | } |
40 | 40 |