@@ -53,7 +53,7 @@ |
||
53 | 53 | * @param string $uri |
54 | 54 | * @param TypoScriptFrontendController $frontend |
55 | 55 | * |
56 | - * @return array |
|
56 | + * @return string[] |
|
57 | 57 | * |
58 | 58 | * @throws \Exception |
59 | 59 | * |
@@ -67,9 +67,9 @@ |
||
67 | 67 | $speakingUri = $frontend->cObj->typoLink_URL(['parameter' => $matches[1], 'additionalParams' => $matches[2]]); |
68 | 68 | $speakingUriParts = parse_url($speakingUri); |
69 | 69 | if (false === $speakingUriParts) { |
70 | - throw new \Exception('Could not parse URI: ' . $speakingUri, 1289915976); |
|
70 | + throw new \Exception('Could not parse URI: '.$speakingUri, 1289915976); |
|
71 | 71 | } |
72 | - $speakingUrlPath = '/' . ltrim($speakingUriParts['path'], '/'); |
|
72 | + $speakingUrlPath = '/'.ltrim($speakingUriParts['path'], '/'); |
|
73 | 73 | // Don't change anything if speaking URL is part of old URI: |
74 | 74 | // (it might be the case the using the speaking URL failed) |
75 | 75 | if (strpos($uri, $speakingUrlPath) !== 0 || $speakingUrlPath === '/') { |
@@ -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 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function execute() |
48 | 48 | { |
49 | 49 | $processManager = new \tx_crawler_domain_process_manager(); |
50 | - $timeout = is_int($this->timeOut) ? (int)$this->timeOut : 1800; |
|
50 | + $timeout = is_int($this->timeOut) ? (int) $this->timeOut : 1800; |
|
51 | 51 | |
52 | 52 | try { |
53 | 53 | $processManager->multiProcess($timeout); |
@@ -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,7 +53,7 @@ |
||
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> |
@@ -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 |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $res = $db->exec_SELECTquery( |
212 | 212 | 'configuration, count(*) as c', |
213 | 213 | $this->tableName, |
214 | - 'set_id in ('. implode(',', $setIds).') AND scheduled < '.time(), |
|
214 | + 'set_id in ('.implode(',', $setIds).') AND scheduled < '.time(), |
|
215 | 215 | 'configuration' |
216 | 216 | ); |
217 | 217 | while ($row = $db->sql_fetch_assoc($res)) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $res = $db->exec_SELECTquery( |
292 | 292 | 'process_id_completed, min(exec_time) as start, max(exec_time) as end, count(*) as urlcount', |
293 | 293 | $this->tableName, |
294 | - 'exec_time != 0 and exec_time >= '.intval($start). ' and exec_time <= ' . intval($end), |
|
294 | + 'exec_time != 0 and exec_time >= '.intval($start).' and exec_time <= '.intval($end), |
|
295 | 295 | 'process_id_completed' |
296 | 296 | ); |
297 | 297 |
@@ -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) |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | protected function getRefreshLink() |
341 | 341 | { |
342 | - 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') . '" />'; |
|
342 | + 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').'" />'; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -360,9 +360,9 @@ discard block |
||
360 | 360 | protected function getEnableDisableLink() |
361 | 361 | { |
362 | 362 | if ($this->getIsCrawlerEnabled()) { |
363 | - 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') . '" />'; |
|
363 | + 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').'" />'; |
|
364 | 364 | } else { |
365 | - 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') . '" />'; |
|
365 | + 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').'" />'; |
|
366 | 366 | } |
367 | 367 | } |
368 | 368 | |
@@ -375,9 +375,9 @@ discard block |
||
375 | 375 | protected function getModeLink() |
376 | 376 | { |
377 | 377 | if ($this->getMode() == 'detail') { |
378 | - 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') . '" />'; |
|
378 | + 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').'" />'; |
|
379 | 379 | } elseif ($this->getMode() == 'simple') { |
380 | - 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') . '" />'; |
|
380 | + 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').'" />'; |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | protected function getAddLink() |
391 | 391 | { |
392 | 392 | if ($this->getActiveProcessCount() < $this->getMaxActiveProcessCount() && $this->getIsCrawlerEnabled()) { |
393 | - 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') . '" />'; |
|
393 | + 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').'" />'; |
|
394 | 394 | } else { |
395 | 395 | return ''; |
396 | 396 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | if (!empty($title)) { |
418 | 418 | $title = ' title="'.$title.'"'; |
419 | 419 | } |
420 | - return '<img src="'.$this->getIconPath().$icon.'.png" ' . $title . ' />'; |
|
420 | + return '<img src="'.$this->getIconPath().$icon.'.png" '.$title.' />'; |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -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."]; |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $this->cli_options[] = ['-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include."]; |
59 | 59 | $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!"]; |
60 | 60 | $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"']; |
61 | - $this->cli_options[] = ['-conf configurationkeys','List of Configuration Keys','A commaseperated list of crawler configurations']; |
|
61 | + $this->cli_options[] = ['-conf configurationkeys', 'List of Configuration Keys', 'A commaseperated list of crawler configurations']; |
|
62 | 62 | # $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"); |
63 | 63 | |
64 | 64 | // Setting help texts: |
@@ -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 | } |