@@ -318,7 +318,7 @@ |
||
| 318 | 318 | return \AOE\Crawler\Utility\ButtonUtility::getLinkButton( |
| 319 | 319 | 'actions-refresh', |
| 320 | 320 | $this->getLLLabel('LLL:EXT:crawler/modfunc1/locallang.xml:labels.refresh'), |
| 321 | - 'window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess&id=' . $this->pageId . '\';' |
|
| 321 | + 'window.location=\''.\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info').'&SET[crawlaction]=multiprocess&id='.$this->pageId.'\';' |
|
| 322 | 322 | ); |
| 323 | 323 | } |
| 324 | 324 | |
@@ -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> |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function offsetGet($index) |
| 52 | 52 | { |
| 53 | - if (! parent::offsetExists($index)) { |
|
| 54 | - throw new Exception('Index "' . var_export($index, true) . '" for tx_crawler_domain_process are not available'); |
|
| 53 | + if (!parent::offsetExists($index)) { |
|
| 54 | + throw new Exception('Index "'.var_export($index, true).'" for tx_crawler_domain_process are not available'); |
|
| 55 | 55 | } |
| 56 | 56 | return parent::offsetGet($index); |
| 57 | 57 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function offsetSet($index, $subject) |
| 68 | 68 | { |
| 69 | - if (! $subject instanceof tx_crawler_domain_process) { |
|
| 69 | + if (!$subject instanceof tx_crawler_domain_process) { |
|
| 70 | 70 | throw new InvalidArgumentException('Wrong parameter type given, "tx_crawler_domain_process" expected!'); |
| 71 | 71 | } |
| 72 | 72 | parent::offsetSet($index, $subject); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function append($subject) |
| 82 | 82 | { |
| 83 | - if (! $subject instanceof tx_crawler_domain_process) { |
|
| 83 | + if (!$subject instanceof tx_crawler_domain_process) { |
|
| 84 | 84 | throw new InvalidArgumentException('Wrong parameter type given, "tx_crawler_domain_process" expected!'); |
| 85 | 85 | } |
| 86 | 86 | parent::append($subject); |
@@ -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 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | list($key, $value) = explode(':', $additionalHeader, 2); |
| 34 | 34 | $key = str_replace('-', '_', strtoupper(trim($key))); |
| 35 | 35 | if ($key != 'HOST') { |
| 36 | - $_SERVER['HTTP_' . $key] = $value; |
|
| 36 | + $_SERVER['HTTP_'.$key] = $value; |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -54,18 +54,18 @@ discard block |
||
| 54 | 54 | $typo3SitePath = $_SERVER['argv'][1]; |
| 55 | 55 | |
| 56 | 56 | // faking the environment |
| 57 | -$_SERVER['DOCUMENT_ROOT'] = preg_replace('#' . preg_quote($typo3SitePath, '#') . '$#', '', $typo3Root); |
|
| 57 | +$_SERVER['DOCUMENT_ROOT'] = preg_replace('#'.preg_quote($typo3SitePath, '#').'$#', '', $typo3Root); |
|
| 58 | 58 | $_SERVER['HTTP_USER_AGENT'] = 'CLI Mode'; |
| 59 | 59 | $_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'] = $urlParts['host']; |
| 60 | -$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $typo3SitePath . 'index.php'; |
|
| 61 | -$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'] = $typo3Root . 'index.php'; |
|
| 60 | +$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = $typo3SitePath.'index.php'; |
|
| 61 | +$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'] = $typo3Root.'index.php'; |
|
| 62 | 62 | $_SERVER['QUERY_STRING'] = (isset($urlParts['query']) ? $urlParts['query'] : ''); |
| 63 | -$_SERVER['REQUEST_URI'] = $urlParts['path'] . (isset($urlParts['query']) ? '?' . $urlParts['query'] : ''); |
|
| 63 | +$_SERVER['REQUEST_URI'] = $urlParts['path'].(isset($urlParts['query']) ? '?'.$urlParts['query'] : ''); |
|
| 64 | 64 | $_SERVER['REQUEST_METHOD'] = 'GET'; |
| 65 | 65 | |
| 66 | 66 | // Define a port if used in the URL: |
| 67 | 67 | if (isset($urlParts['port'])) { |
| 68 | - $_SERVER['HTTP_HOST'] .= ':' . $urlParts['port']; |
|
| 68 | + $_SERVER['HTTP_HOST'] .= ':'.$urlParts['port']; |
|
| 69 | 69 | $_SERVER['SERVER_PORT'] = $urlParts['port']; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | chdir($typo3Root); |
| 78 | -include($typo3Root . '/index.php'); |
|
| 78 | +include($typo3Root.'/index.php'); |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Checks if the $path is absolute or relative (detecting either '/' or 'x:/' as first part of string) and returns TRUE if so. |
@@ -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: |
@@ -45,36 +45,36 @@ |
||
| 45 | 45 | { |
| 46 | 46 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['AOE\\Crawler\\Task\\CrawlerQueueTask'] = [ |
| 47 | 47 | 'extension' => $extKey, |
| 48 | - 'title' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_im.name', |
|
| 49 | - 'description' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_im.description', |
|
| 48 | + 'title' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_im.name', |
|
| 49 | + 'description' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_im.description', |
|
| 50 | 50 | 'additionalFields' => CrawlerQueueTaskAdditionalFieldProvider::class |
| 51 | 51 | ]; |
| 52 | 52 | |
| 53 | 53 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['AOE\\Crawler\\Task\\CrawlerTask'] = [ |
| 54 | 54 | 'extension' => $extKey, |
| 55 | - 'title' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_crawl.name', |
|
| 56 | - 'description' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_crawl.description', |
|
| 55 | + 'title' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_crawl.name', |
|
| 56 | + 'description' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_crawl.description', |
|
| 57 | 57 | 'additionalFields' => CrawlerTaskAdditionalFieldProvider::class |
| 58 | 58 | ]; |
| 59 | 59 | |
| 60 | 60 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['AOE\\Crawler\\Task\\CrawlMultiProcessTask'] = [ |
| 61 | 61 | 'extension' => $extKey, |
| 62 | - 'title' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_crawlMultiProcess.name', |
|
| 63 | - 'description' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_crawl.description', |
|
| 62 | + 'title' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_crawlMultiProcess.name', |
|
| 63 | + 'description' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_crawl.description', |
|
| 64 | 64 | 'additionalFields' => CrawlMultiProcessTaskAdditionalFieldProvider::class |
| 65 | 65 | ]; |
| 66 | 66 | |
| 67 | 67 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['AOE\\Crawler\\Task\\FlushQueueTask'] = [ |
| 68 | 68 | 'extension' => $extKey, |
| 69 | - 'title' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_flush.name', |
|
| 70 | - 'description' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_flush.description', |
|
| 69 | + 'title' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_flush.name', |
|
| 70 | + 'description' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_flush.description', |
|
| 71 | 71 | 'additionalFields' => FlushQueueTaskAdditionalFieldProvider::class |
| 72 | 72 | ]; |
| 73 | 73 | |
| 74 | 74 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['AOE\\Crawler\\Task\\ProcessCleanupTask'] = [ |
| 75 | 75 | 'extension' => $extKey, |
| 76 | - 'title' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_processCleanup.name', |
|
| 77 | - 'description' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/Backend.xlf:crawler_processCleanup.description', |
|
| 76 | + 'title' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_processCleanup.name', |
|
| 77 | + 'description' => 'LLL:EXT:'.$extKey.'/Resources/Private/Language/Backend.xlf:crawler_processCleanup.description', |
|
| 78 | 78 | ]; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $this->startPage = 0; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $_SERVER['argv'] = [$_SERVER['argv'][0], $this->startPage,'-ss', '-d', $this->depth, '-o', self::MODE, '-conf', implode(',', $this->configuration)]; |
|
| 87 | + $_SERVER['argv'] = [$_SERVER['argv'][0], $this->startPage, '-ss', '-d', $this->depth, '-o', self::MODE, '-conf', implode(',', $this->configuration)]; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -100,6 +100,6 @@ discard block |
||
| 100 | 100 | $this->startPage = 0; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - return implode(',', $this->configuration) . ' (depth: ' . $this->depth . ', startPage:' . $this->startPage . ')'; |
|
| 103 | + return implode(',', $this->configuration).' (depth: '.$this->depth.', startPage:'.$this->startPage.')'; |
|
| 104 | 104 | } |
| 105 | 105 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $additionalParameters = []; |
| 68 | 68 | $additionalParameters[] = 'SET[function]=tx_crawler_modfunc1'; |
| 69 | 69 | $additionalParameters[] = 'SET[crawlaction]=start'; |
| 70 | - $additionalParameters[] = 'configurationSelection[]=' . $crawlerConfiguration['name']; |
|
| 70 | + $additionalParameters[] = 'configurationSelection[]='.$crawlerConfiguration['name']; |
|
| 71 | 71 | |
| 72 | 72 | $additionalMenuItems = []; |
| 73 | 73 | $additionalMenuItems[] = $backRef->linkItem( |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | 'crawler' |
| 77 | 77 | ), |
| 78 | 78 | $this->getContextMenuIcon(), |
| 79 | - 'top.goToModule(\'web_info\', 1, \'&' . implode('&', $additionalParameters) . '\'); return hideCM();' |
|
| 79 | + 'top.goToModule(\'web_info\', 1, \'&'.implode('&', $additionalParameters).'\'); return hideCM();' |
|
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | return array_merge($menuItems, $additionalMenuItems); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $icon = sprintf( |
| 93 | 93 | '<img src="%s" border="0" align="top" alt="" />', |
| 94 | - ExtensionManagementUtility::extRelPath('crawler') . 'Resources/Private/Icons/icon_tx_crawler_configuration.gif' |
|
| 94 | + ExtensionManagementUtility::extRelPath('crawler').'Resources/Private/Icons/icon_tx_crawler_configuration.gif' |
|
| 95 | 95 | ); |
| 96 | 96 | |
| 97 | 97 | return $icon; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | public $setID = 0; |
| 33 | 33 | public $processID = ''; |
| 34 | - public $max_CLI_exec_time = 3600; // One hour is max stalled time for the CLI (If the process has had the status "start" for 3600 seconds it will be regarded stalled and a new process is started. |
|
| 34 | + public $max_CLI_exec_time = 3600; // One hour is max stalled time for the CLI (If the process has had the status "start" for 3600 seconds it will be regarded stalled and a new process is started. |
|
| 35 | 35 | |
| 36 | 36 | public $duplicateTrack = []; |
| 37 | 37 | public $downloadUrls = []; |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | private $backendUser; |
| 70 | 70 | |
| 71 | 71 | const CLI_STATUS_NOTHING_PROCCESSED = 0; |
| 72 | - const CLI_STATUS_REMAIN = 1; //queue not empty |
|
| 73 | - const CLI_STATUS_PROCESSED = 2; //(some) queue items where processed |
|
| 74 | - const CLI_STATUS_ABORTED = 4; //instance didn't finish |
|
| 72 | + const CLI_STATUS_REMAIN = 1; //queue not empty |
|
| 73 | + const CLI_STATUS_PROCESSED = 2; //(some) queue items where processed |
|
| 74 | + const CLI_STATUS_ABORTED = 4; //instance didn't finish |
|
| 75 | 75 | const CLI_STATUS_POLLABLE_PROCESSED = 8; |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -355,14 +355,14 @@ discard block |
||
| 355 | 355 | if ($vv['subCfg']['cHash']) { |
| 356 | 356 | /* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */ |
| 357 | 357 | $cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\Page\CacheHashCalculator'); |
| 358 | - $urlQuery .= '&cHash=' . $cacheHash->generateForParameters($urlQuery); |
|
| 358 | + $urlQuery .= '&cHash='.$cacheHash->generateForParameters($urlQuery); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | // Create key by which to determine unique-ness: |
| 362 | 362 | $uKey = $urlQuery.'|'.$vv['subCfg']['userGroups'].'|'.$vv['subCfg']['baseUrl'].'|'.$vv['subCfg']['procInstrFilter']; |
| 363 | 363 | |
| 364 | 364 | // realurl support (thanks to Ingo Renner) |
| 365 | - $urlQuery = 'index.php' . $urlQuery; |
|
| 365 | + $urlQuery = 'index.php'.$urlQuery; |
|
| 366 | 366 | if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl') && $vv['subCfg']['realurl']) { |
| 367 | 367 | $params = [ |
| 368 | 368 | 'LD' => [ |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | $urlList = '['.date('d.m.y H:i', $schTime).'] '.htmlspecialchars($urlQuery); |
| 387 | 387 | $this->urlList[] = '['.date('d.m.y H:i', $schTime).'] '.$urlQuery; |
| 388 | 388 | |
| 389 | - $theUrl = ($vv['subCfg']['baseUrl'] ? $vv['subCfg']['baseUrl'] : \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')) . $urlQuery; |
|
| 389 | + $theUrl = ($vv['subCfg']['baseUrl'] ? $vv['subCfg']['baseUrl'] : \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')).$urlQuery; |
|
| 390 | 390 | |
| 391 | 391 | // Submit for crawling! |
| 392 | 392 | if ($submitCrawlUrls) { |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | if (!is_array($values)) { |
| 489 | 489 | |
| 490 | 490 | // Sub configuration for a single configuration string: |
| 491 | - $subCfg = (array)$crawlerCfg['paramSets.'][$key.'.']; |
|
| 491 | + $subCfg = (array) $crawlerCfg['paramSets.'][$key.'.']; |
|
| 492 | 492 | $subCfg['key'] = $key; |
| 493 | 493 | |
| 494 | 494 | if (strcmp($subCfg['procInstrFilter'], '')) { |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | 'tx_crawler_configuration', |
| 536 | 536 | 'pid', |
| 537 | 537 | intval($page['uid']), |
| 538 | - \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration') |
|
| 538 | + \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration').\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration') |
|
| 539 | 539 | ); |
| 540 | 540 | |
| 541 | 541 | if (is_array($configurationRecordsForCurrentPage)) { |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | $res[$key]['subCfg'] = $subCfg; |
| 582 | 582 | $res[$key]['paramParsed'] = $this->parseParams($configurationRecord['configuration']); |
| 583 | 583 | $res[$key]['paramExpanded'] = $this->expandParameters($res[$key]['paramParsed'], $id); |
| 584 | - $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id=' . $id]); |
|
| 584 | + $res[$key]['URLs'] = $this->compileUrls($res[$key]['paramExpanded'], ['?id='.$id]); |
|
| 585 | 585 | $res[$key]['origin'] = 'tx_crawler_configuration_'.$configurationRecord['uid']; |
| 586 | 586 | } |
| 587 | 587 | } |
@@ -620,13 +620,13 @@ discard block |
||
| 620 | 620 | $res = $this->db->exec_SELECTquery( |
| 621 | 621 | '*', |
| 622 | 622 | 'sys_domain', |
| 623 | - 'uid = '.$sysDomainUid . |
|
| 624 | - \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_domain') . |
|
| 623 | + 'uid = '.$sysDomainUid. |
|
| 624 | + \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_domain'). |
|
| 625 | 625 | \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_domain') |
| 626 | 626 | ); |
| 627 | 627 | $row = $this->db->sql_fetch_assoc($res); |
| 628 | 628 | if ($row['domainName'] != '') { |
| 629 | - return $urlScheme . '://' . $row['domainName']; |
|
| 629 | + return $urlScheme.'://'.$row['domainName']; |
|
| 630 | 630 | } |
| 631 | 631 | } |
| 632 | 632 | return $baseUrl; |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | if (!is_array($value)) { |
| 645 | 645 | continue; |
| 646 | 646 | } |
| 647 | - $configurationsForBranch[] = substr($key, -1) == '.'?substr($key, 0, -1):$key; |
|
| 647 | + $configurationsForBranch[] = substr($key, -1) == '.' ?substr($key, 0, -1) : $key; |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | } |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | /* @var \TYPO3\CMS\Backend\Tree\View\PageTreeView */ |
| 657 | 657 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 658 | 658 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| 659 | - $tree->init('AND ' . $perms_clause); |
|
| 659 | + $tree->init('AND '.$perms_clause); |
|
| 660 | 660 | $tree->getTree($rootid, $depth, ''); |
| 661 | 661 | foreach ($tree->tree as $node) { |
| 662 | 662 | $pids[] = $node['row']['uid']; |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | '*', |
| 667 | 667 | 'tx_crawler_configuration', |
| 668 | 668 | 'pid IN ('.implode(',', $pids).') '. |
| 669 | - \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration') . |
|
| 669 | + \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('tx_crawler_configuration'). |
|
| 670 | 670 | \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tx_crawler_configuration').' '. |
| 671 | 671 | \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('tx_crawler_configuration').' ' |
| 672 | 672 | ); |
@@ -766,8 +766,8 @@ discard block |
||
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | // Traverse range, add values: |
| 769 | - $runAwayBrake = 1000; // Limit to size of range! |
|
| 770 | - for ($a = $reg[1]; $a <= $reg[2];$a++) { |
|
| 769 | + $runAwayBrake = 1000; // Limit to size of range! |
|
| 770 | + for ($a = $reg[1]; $a <= $reg[2]; $a++) { |
|
| 771 | 771 | $paramArray[$p][] = $a; |
| 772 | 772 | $runAwayBrake--; |
| 773 | 773 | if ($runAwayBrake <= 0) { |
@@ -797,16 +797,16 @@ discard block |
||
| 797 | 797 | $transOrigPointerField = $TCA[$subpartParams['_TABLE']]['ctrl']['transOrigPointerField']; |
| 798 | 798 | |
| 799 | 799 | if ($subpartParams['_ENABLELANG'] && $transOrigPointerField) { |
| 800 | - $andWhereLanguage = ' AND ' . $this->db->quoteStr($transOrigPointerField, $subpartParams['_TABLE']) .' <= 0 '; |
|
| 800 | + $andWhereLanguage = ' AND '.$this->db->quoteStr($transOrigPointerField, $subpartParams['_TABLE']).' <= 0 '; |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | - $where = $this->db->quoteStr($pidField, $subpartParams['_TABLE']) .'='.intval($lookUpPid) . ' ' . |
|
| 804 | - $andWhereLanguage . $where; |
|
| 803 | + $where = $this->db->quoteStr($pidField, $subpartParams['_TABLE']).'='.intval($lookUpPid).' '. |
|
| 804 | + $andWhereLanguage.$where; |
|
| 805 | 805 | |
| 806 | 806 | $rows = $this->db->exec_SELECTgetRows( |
| 807 | 807 | $fieldName, |
| 808 | - $subpartParams['_TABLE'] . $addTable, |
|
| 809 | - $where . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($subpartParams['_TABLE']), |
|
| 808 | + $subpartParams['_TABLE'].$addTable, |
|
| 809 | + $where.\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($subpartParams['_TABLE']), |
|
| 810 | 810 | '', |
| 811 | 811 | '', |
| 812 | 812 | '', |
@@ -915,13 +915,13 @@ discard block |
||
| 915 | 915 | |
| 916 | 916 | // FIXME: Write unit test that ensures that the right records are deleted. |
| 917 | 917 | if ($doFlush) { |
| 918 | - $this->flushQueue(($doFullFlush?'1=1':('page_id='.intval($id))) .$addWhere); |
|
| 918 | + $this->flushQueue(($doFullFlush ? '1=1' : ('page_id='.intval($id))).$addWhere); |
|
| 919 | 919 | return []; |
| 920 | 920 | } else { |
| 921 | 921 | return $this->db->exec_SELECTgetRows( |
| 922 | 922 | '*', |
| 923 | 923 | 'tx_crawler_queue', |
| 924 | - 'page_id=' . intval($id) . $addWhere, |
|
| 924 | + 'page_id='.intval($id).$addWhere, |
|
| 925 | 925 | '', |
| 926 | 926 | 'scheduled DESC', |
| 927 | 927 | (intval($itemsPerPage) > 0 ? intval($itemsPerPage) : '') |
@@ -954,7 +954,7 @@ discard block |
||
| 954 | 954 | } |
| 955 | 955 | // FIXME: Write unit test that ensures that the right records are deleted. |
| 956 | 956 | if ($doFlush) { |
| 957 | - $this->flushQueue($doFullFlush?'':('set_id='.intval($set_id).$addWhere)); |
|
| 957 | + $this->flushQueue($doFullFlush ? '' : ('set_id='.intval($set_id).$addWhere)); |
|
| 958 | 958 | return []; |
| 959 | 959 | } else { |
| 960 | 960 | return $this->db->exec_SELECTgetRows( |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | protected function flushQueue($where = '') |
| 978 | 978 | { |
| 979 | - $realWhere = strlen($where) > 0?$where:'1=1'; |
|
| 979 | + $realWhere = strlen($where) > 0 ? $where : '1=1'; |
|
| 980 | 980 | |
| 981 | 981 | if (tx_crawler_domain_events_dispatcher::getInstance()->hasObserver('queueEntryFlush')) { |
| 982 | 982 | $groups = $this->db->exec_SELECTgetRows('DISTINCT set_id', 'tx_crawler_queue', $realWhere); |
@@ -1123,13 +1123,13 @@ discard block |
||
| 1123 | 1123 | if ($this->extensionSettings['enableTimeslot']) { |
| 1124 | 1124 | $timeBegin = $currentTime - 100; |
| 1125 | 1125 | $timeEnd = $currentTime + 100; |
| 1126 | - $where = ' ((scheduled BETWEEN '.$timeBegin.' AND '.$timeEnd.' ) OR scheduled <= '. $currentTime.') '; |
|
| 1126 | + $where = ' ((scheduled BETWEEN '.$timeBegin.' AND '.$timeEnd.' ) OR scheduled <= '.$currentTime.') '; |
|
| 1127 | 1127 | } else { |
| 1128 | - $where = 'scheduled <= ' . $currentTime; |
|
| 1128 | + $where = 'scheduled <= '.$currentTime; |
|
| 1129 | 1129 | } |
| 1130 | 1130 | } elseif ($tstamp > $currentTime) { |
| 1131 | 1131 | //entry with a timestamp in the future need to have the same schedule time |
| 1132 | - $where = 'scheduled = ' . $tstamp ; |
|
| 1132 | + $where = 'scheduled = '.$tstamp; |
|
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | if (!empty($where)) { |
@@ -1137,10 +1137,10 @@ discard block |
||
| 1137 | 1137 | 'qid', |
| 1138 | 1138 | 'tx_crawler_queue', |
| 1139 | 1139 | $where. |
| 1140 | - ' AND NOT exec_time' . |
|
| 1140 | + ' AND NOT exec_time'. |
|
| 1141 | 1141 | ' AND NOT process_id '. |
| 1142 | 1142 | ' AND page_id='.intval($fieldArray['page_id']). |
| 1143 | - ' AND parameters_hash = ' . $this->db->fullQuoteStr($fieldArray['parameters_hash'], 'tx_crawler_queue') |
|
| 1143 | + ' AND parameters_hash = '.$this->db->fullQuoteStr($fieldArray['parameters_hash'], 'tx_crawler_queue') |
|
| 1144 | 1144 | ); |
| 1145 | 1145 | |
| 1146 | 1146 | if (is_array($result)) { |
@@ -1180,13 +1180,13 @@ discard block |
||
| 1180 | 1180 | { |
| 1181 | 1181 | $ret = 0; |
| 1182 | 1182 | if ($this->debugMode) { |
| 1183 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl start ' . microtime(true), __FUNCTION__); |
|
| 1183 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl start '.microtime(true), __FUNCTION__); |
|
| 1184 | 1184 | } |
| 1185 | 1185 | // Get entry: |
| 1186 | 1186 | list($queueRec) = $this->db->exec_SELECTgetRows( |
| 1187 | 1187 | '*', |
| 1188 | 1188 | 'tx_crawler_queue', |
| 1189 | - 'qid=' . intval($queueId) . ($force ? '' : ' AND exec_time=0 AND process_scheduled > 0') |
|
| 1189 | + 'qid='.intval($queueId).($force ? '' : ' AND exec_time=0 AND process_scheduled > 0') |
|
| 1190 | 1190 | ); |
| 1191 | 1191 | |
| 1192 | 1192 | if (!is_array($queueRec)) { |
@@ -1195,10 +1195,10 @@ discard block |
||
| 1195 | 1195 | |
| 1196 | 1196 | $parameters = unserialize($queueRec['parameters']); |
| 1197 | 1197 | if ($parameters['rootTemplatePid']) { |
| 1198 | - $this->initTSFE((int)$parameters['rootTemplatePid']); |
|
| 1198 | + $this->initTSFE((int) $parameters['rootTemplatePid']); |
|
| 1199 | 1199 | } else { |
| 1200 | 1200 | \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog( |
| 1201 | - 'Page with (' . $queueRec['page_id'] . ') could not be crawled, please check your crawler configuration. Perhaps no Root Template Pid is set', |
|
| 1201 | + 'Page with ('.$queueRec['page_id'].') could not be crawled, please check your crawler configuration. Perhaps no Root Template Pid is set', |
|
| 1202 | 1202 | 'crawler', |
| 1203 | 1203 | \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING |
| 1204 | 1204 | ); |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | //if mulitprocessing is used we need to store the id of the process which has handled this entry |
| 1218 | 1218 | $field_array['process_id_completed'] = $this->processID; |
| 1219 | 1219 | } |
| 1220 | - $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid=' . intval($queueId), $field_array); |
|
| 1220 | + $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid='.intval($queueId), $field_array); |
|
| 1221 | 1221 | |
| 1222 | 1222 | $result = $this->readUrl_exec($queueRec); |
| 1223 | 1223 | $resultData = unserialize($result['content']); |
@@ -1248,10 +1248,10 @@ discard block |
||
| 1248 | 1248 | [$queueId, &$field_array] |
| 1249 | 1249 | ); |
| 1250 | 1250 | |
| 1251 | - $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid=' . intval($queueId), $field_array); |
|
| 1251 | + $this->db->exec_UPDATEquery('tx_crawler_queue', 'qid='.intval($queueId), $field_array); |
|
| 1252 | 1252 | |
| 1253 | 1253 | if ($this->debugMode) { |
| 1254 | - \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl stop ' . microtime(true), __FUNCTION__); |
|
| 1254 | + \TYPO3\CMS\Core\Utility\GeneralUtility::devlog('crawler-readurl stop '.microtime(true), __FUNCTION__); |
|
| 1255 | 1255 | } |
| 1256 | 1256 | |
| 1257 | 1257 | return $ret; |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | return false; |
| 1349 | 1349 | } |
| 1350 | 1350 | |
| 1351 | - if (!in_array($url['scheme'], ['','http','https'])) { |
|
| 1351 | + if (!in_array($url['scheme'], ['', 'http', 'https'])) { |
|
| 1352 | 1352 | if (TYPO3_DLOG) { |
| 1353 | 1353 | \TYPO3\CMS\Core\Utility\GeneralUtility::devLog(sprintf('Scheme does not match for url "%s"', $url), 'crawler', 4, ['crawlerId' => $crawlerId]); |
| 1354 | 1354 | } |
@@ -1368,14 +1368,14 @@ discard block |
||
| 1368 | 1368 | |
| 1369 | 1369 | if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlUse'] && $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']) { |
| 1370 | 1370 | $rurl = parse_url($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']); |
| 1371 | - $url['path'] = $url['scheme'] . '://' . $url['host'] . ($url['port'] > 0 ? ':' . $url['port'] : '') . $url['path']; |
|
| 1371 | + $url['path'] = $url['scheme'].'://'.$url['host'].($url['port'] > 0 ? ':'.$url['port'] : '').$url['path']; |
|
| 1372 | 1372 | $reqHeaders = $this->buildRequestHeaderArray($url, $crawlerId); |
| 1373 | 1373 | } |
| 1374 | 1374 | |
| 1375 | 1375 | $host = $rurl['host']; |
| 1376 | 1376 | |
| 1377 | 1377 | if ($url['scheme'] == 'https') { |
| 1378 | - $host = 'ssl://' . $host; |
|
| 1378 | + $host = 'ssl://'.$host; |
|
| 1379 | 1379 | $port = ($rurl['port'] > 0) ? $rurl['port'] : 443; |
| 1380 | 1380 | } else { |
| 1381 | 1381 | $port = ($rurl['port'] > 0) ? $rurl['port'] : 80; |
@@ -1399,13 +1399,13 @@ discard block |
||
| 1399 | 1399 | fclose($fp); |
| 1400 | 1400 | |
| 1401 | 1401 | $time = microtime(true) - $startTime; |
| 1402 | - $this->log($originalUrl .' '.$time); |
|
| 1402 | + $this->log($originalUrl.' '.$time); |
|
| 1403 | 1403 | |
| 1404 | 1404 | // Implode content and headers: |
| 1405 | 1405 | $result = [ |
| 1406 | 1406 | 'request' => $msg, |
| 1407 | 1407 | 'headers' => implode('', $d['headers']), |
| 1408 | - 'content' => implode('', (array)$d['content']) |
|
| 1408 | + 'content' => implode('', (array) $d['content']) |
|
| 1409 | 1409 | ]; |
| 1410 | 1410 | |
| 1411 | 1411 | if (($this->extensionSettings['follow30x']) && ($newUrl = $this->getRequestUrlFrom302Header($d['headers'], $url['user'], $url['pass']))) { |
@@ -1450,8 +1450,8 @@ discard block |
||
| 1450 | 1450 | |
| 1451 | 1451 | // Base path must be '/<pathSegements>/': |
| 1452 | 1452 | if ($frontendBasePath != '/') { |
| 1453 | - $frontendBasePath = '/' . ltrim($frontendBasePath, '/'); |
|
| 1454 | - $frontendBasePath = rtrim($frontendBasePath, '/') . '/'; |
|
| 1453 | + $frontendBasePath = '/'.ltrim($frontendBasePath, '/'); |
|
| 1454 | + $frontendBasePath = rtrim($frontendBasePath, '/').'/'; |
|
| 1455 | 1455 | } |
| 1456 | 1456 | |
| 1457 | 1457 | return $frontendBasePath; |
@@ -1507,7 +1507,7 @@ discard block |
||
| 1507 | 1507 | protected function log($message) |
| 1508 | 1508 | { |
| 1509 | 1509 | if (!empty($this->extensionSettings['logFileName'])) { |
| 1510 | - @file_put_contents($this->extensionSettings['logFileName'], date('Ymd His') . ' ' . $message . PHP_EOL, FILE_APPEND); |
|
| 1510 | + @file_put_contents($this->extensionSettings['logFileName'], date('Ymd His').' '.$message.PHP_EOL, FILE_APPEND); |
|
| 1511 | 1511 | } |
| 1512 | 1512 | } |
| 1513 | 1513 | |
@@ -1529,7 +1529,7 @@ discard block |
||
| 1529 | 1529 | } |
| 1530 | 1530 | $reqHeaders[] = 'Connection: close'; |
| 1531 | 1531 | if ($url['user'] != '') { |
| 1532 | - $reqHeaders[] = 'Authorization: Basic '. base64_encode($url['user'].':'.$url['pass']); |
|
| 1532 | + $reqHeaders[] = 'Authorization: Basic '.base64_encode($url['user'].':'.$url['pass']); |
|
| 1533 | 1533 | } |
| 1534 | 1534 | $reqHeaders[] = 'X-T3crawler: '.$crawlerId; |
| 1535 | 1535 | $reqHeaders[] = 'User-Agent: TYPO3 crawler'; |
@@ -1568,9 +1568,9 @@ discard block |
||
| 1568 | 1568 | if (!($tmp = parse_url($header['Location']))) { |
| 1569 | 1569 | return false; |
| 1570 | 1570 | } |
| 1571 | - $newUrl = $tmp['scheme'] . '://' . $user . ':' . $pass . '@' . $tmp['host'] . $tmp['path']; |
|
| 1571 | + $newUrl = $tmp['scheme'].'://'.$user.':'.$pass.'@'.$tmp['host'].$tmp['path']; |
|
| 1572 | 1572 | if ($tmp['query'] != '') { |
| 1573 | - $newUrl .= '?' . $tmp['query']; |
|
| 1573 | + $newUrl .= '?'.$tmp['query']; |
|
| 1574 | 1574 | } |
| 1575 | 1575 | } else { |
| 1576 | 1576 | $newUrl = $header['Location']; |
@@ -1658,7 +1658,7 @@ discard block |
||
| 1658 | 1658 | /* @var $tree \TYPO3\CMS\Backend\Tree\View\PageTreeView */ |
| 1659 | 1659 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 1660 | 1660 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| 1661 | - $tree->init('AND ' . $perms_clause); |
|
| 1661 | + $tree->init('AND '.$perms_clause); |
|
| 1662 | 1662 | |
| 1663 | 1663 | $pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($id, $perms_clause); |
| 1664 | 1664 | |
@@ -1708,7 +1708,7 @@ discard block |
||
| 1708 | 1708 | |
| 1709 | 1709 | $code .= $this->drawURLs_addRowsForPage( |
| 1710 | 1710 | $data['row'], |
| 1711 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true) |
|
| 1711 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], true) |
|
| 1712 | 1712 | ); |
| 1713 | 1713 | } |
| 1714 | 1714 | |
@@ -1733,7 +1733,7 @@ discard block |
||
| 1733 | 1733 | if (!empty($excludeString)) { |
| 1734 | 1734 | /* @var $tree \TYPO3\CMS\Backend\Tree\View\PageTreeView */ |
| 1735 | 1735 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 1736 | - $tree->init('AND ' . $this->backendUser->getPagePermsClause(1)); |
|
| 1736 | + $tree->init('AND '.$this->backendUser->getPagePermsClause(1)); |
|
| 1737 | 1737 | |
| 1738 | 1738 | $excludeParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $excludeString); |
| 1739 | 1739 | |
@@ -1853,17 +1853,17 @@ discard block |
||
| 1853 | 1853 | |
| 1854 | 1854 | // Compile row: |
| 1855 | 1855 | $content .= ' |
| 1856 | - <tr class="bgColor' . ($c % 2 ? '-20':'-10') . '"> |
|
| 1857 | - ' . $titleClm . ' |
|
| 1858 | - <td>' . htmlspecialchars($confKey) . '</td> |
|
| 1859 | - <td>' . nl2br(htmlspecialchars(rawurldecode(trim(str_replace('&', chr(10) . '&', \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $confArray['paramParsed'])))))) . '</td> |
|
| 1856 | + <tr class="bgColor' . ($c % 2 ? '-20' : '-10').'"> |
|
| 1857 | + ' . $titleClm.' |
|
| 1858 | + <td>' . htmlspecialchars($confKey).'</td> |
|
| 1859 | + <td>' . nl2br(htmlspecialchars(rawurldecode(trim(str_replace('&', chr(10).'&', \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $confArray['paramParsed'])))))).'</td> |
|
| 1860 | 1860 | <td>'.$paramExpanded.'</td> |
| 1861 | - <td nowrap="nowrap">' . $urlList . '</td> |
|
| 1862 | - <td nowrap="nowrap">' . $optionValues . '</td> |
|
| 1863 | - <td nowrap="nowrap">' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($confArray['subCfg']['procInstrParams.']) . '</td> |
|
| 1861 | + <td nowrap="nowrap">' . $urlList.'</td> |
|
| 1862 | + <td nowrap="nowrap">' . $optionValues.'</td> |
|
| 1863 | + <td nowrap="nowrap">' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($confArray['subCfg']['procInstrParams.']).'</td> |
|
| 1864 | 1864 | </tr>'; |
| 1865 | 1865 | } else { |
| 1866 | - $content .= '<tr class="bgColor'.($c % 2 ? '-20':'-10') . '"> |
|
| 1866 | + $content .= '<tr class="bgColor'.($c % 2 ? '-20' : '-10').'"> |
|
| 1867 | 1867 | '.$titleClm.' |
| 1868 | 1868 | <td>'.htmlspecialchars($confKey).'</td> |
| 1869 | 1869 | <td colspan="5"><em>No entries</em> (Page is excluded in this configuration)</td> |
@@ -2011,7 +2011,7 @@ discard block |
||
| 2011 | 2011 | tx_crawler_domain_events_dispatcher::getInstance()->post( |
| 2012 | 2012 | 'invokeQueueChange', |
| 2013 | 2013 | $this->setID, |
| 2014 | - [ 'reason' => $reason ] |
|
| 2014 | + ['reason' => $reason] |
|
| 2015 | 2015 | ); |
| 2016 | 2016 | } |
| 2017 | 2017 | |
@@ -2111,7 +2111,7 @@ discard block |
||
| 2111 | 2111 | * @param tx_crawler_cli_im $cliObj Command line object |
| 2112 | 2112 | * @return mixed Array of keys or null if no keys found |
| 2113 | 2113 | */ |
| 2114 | - protected function getConfigurationKeys(tx_crawler_cli_im &$cliObj) |
|
| 2114 | + protected function getConfigurationKeys(tx_crawler_cli_im & $cliObj) |
|
| 2115 | 2115 | { |
| 2116 | 2116 | $parameter = trim($cliObj->cli_argValue('-conf')); |
| 2117 | 2117 | return ($parameter != '' ? \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $parameter) : []); |
@@ -2138,7 +2138,7 @@ discard block |
||
| 2138 | 2138 | $purgeDate = $this->getCurrentTime() - 24 * 60 * 60 * intval($this->extensionSettings['purgeQueueDays']); |
| 2139 | 2139 | $del = $this->db->exec_DELETEquery( |
| 2140 | 2140 | 'tx_crawler_queue', |
| 2141 | - 'exec_time!=0 AND exec_time<' . $purgeDate |
|
| 2141 | + 'exec_time!=0 AND exec_time<'.$purgeDate |
|
| 2142 | 2142 | ); |
| 2143 | 2143 | } |
| 2144 | 2144 | |
@@ -2198,7 +2198,7 @@ discard block |
||
| 2198 | 2198 | $result |= $this->readUrl($r['qid']); |
| 2199 | 2199 | |
| 2200 | 2200 | $counter++; |
| 2201 | - usleep(intval($sleepTime)); // Just to relax the system |
|
| 2201 | + usleep(intval($sleepTime)); // Just to relax the system |
|
| 2202 | 2202 | |
| 2203 | 2203 | // if during the start and the current read url the cli has been disable we need to return from the function |
| 2204 | 2204 | // mark the process NOT as ended. |
@@ -2211,7 +2211,7 @@ discard block |
||
| 2211 | 2211 | |
| 2212 | 2212 | //TODO might need an additional returncode |
| 2213 | 2213 | $result |= self::CLI_STATUS_ABORTED; |
| 2214 | - break; //possible timeout |
|
| 2214 | + break; //possible timeout |
|
| 2215 | 2215 | } |
| 2216 | 2216 | } |
| 2217 | 2217 | |
@@ -2327,7 +2327,7 @@ discard block |
||
| 2327 | 2327 | } |
| 2328 | 2328 | |
| 2329 | 2329 | if (!count($releaseIds) > 0) { |
| 2330 | - return false; //nothing to release |
|
| 2330 | + return false; //nothing to release |
|
| 2331 | 2331 | } |
| 2332 | 2332 | |
| 2333 | 2333 | if (!$withinLock) { |
@@ -2471,7 +2471,7 @@ discard block |
||
| 2471 | 2471 | |
| 2472 | 2472 | $cmd = escapeshellcmd($this->extensionSettings['phpPath']); |
| 2473 | 2473 | $cmd .= ' '; |
| 2474 | - $cmd .= escapeshellarg(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler') . 'cli/bootstrap.php'); |
|
| 2474 | + $cmd .= escapeshellarg(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler').'cli/bootstrap.php'); |
|
| 2475 | 2475 | $cmd .= ' '; |
| 2476 | 2476 | $cmd .= escapeshellarg($this->getFrontendBasePath()); |
| 2477 | 2477 | $cmd .= ' '; |
@@ -2481,10 +2481,10 @@ discard block |
||
| 2481 | 2481 | |
| 2482 | 2482 | $startTime = microtime(true); |
| 2483 | 2483 | $content = $this->executeShellCommand($cmd); |
| 2484 | - $this->log($url . ' ' . (microtime(true) - $startTime)); |
|
| 2484 | + $this->log($url.' '.(microtime(true) - $startTime)); |
|
| 2485 | 2485 | |
| 2486 | 2486 | $result = [ |
| 2487 | - 'request' => implode("\r\n", $requestHeaders) . "\r\n\r\n", |
|
| 2487 | + 'request' => implode("\r\n", $requestHeaders)."\r\n\r\n", |
|
| 2488 | 2488 | 'headers' => '', |
| 2489 | 2489 | 'content' => $content |
| 2490 | 2490 | ]; |
@@ -2505,7 +2505,7 @@ discard block |
||
| 2505 | 2505 | $scheduledAgeInSeconds = $this->extensionSettings['cleanUpScheduledAge'] * 86400; |
| 2506 | 2506 | |
| 2507 | 2507 | $now = time(); |
| 2508 | - $condition = '(exec_time<>0 AND exec_time<' . ($now - $processedAgeInSeconds) . ') OR scheduled<=' . ($now - $scheduledAgeInSeconds); |
|
| 2508 | + $condition = '(exec_time<>0 AND exec_time<'.($now - $processedAgeInSeconds).') OR scheduled<='.($now - $scheduledAgeInSeconds); |
|
| 2509 | 2509 | $this->flushQueue($condition); |
| 2510 | 2510 | } |
| 2511 | 2511 | |