@@ -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); |
@@ -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> |
@@ -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 | } |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | { |
| 131 | 131 | if (is_array($this->observers[$event])) { |
| 132 | 132 | foreach ($this->observers[$event] as $eventObserver) { |
| 133 | - call_user_func([$eventObserver['object'],$eventObserver['method']], $event, $group, $attachedData); |
|
| 133 | + call_user_func([$eventObserver['object'], $eventObserver['method']], $event, $group, $attachedData); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -45,17 +45,17 @@ |
||
| 45 | 45 | public static function registerHooks($extKey) |
| 46 | 46 | { |
| 47 | 47 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB']['tx_crawler'] = |
| 48 | - TsfeHook::class . '->fe_init'; |
|
| 48 | + TsfeHook::class.'->fe_init'; |
|
| 49 | 49 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser']['tx_crawler'] = |
| 50 | - TsfeHook::class . '->fe_feuserInit'; |
|
| 50 | + TsfeHook::class.'->fe_feuserInit'; |
|
| 51 | 51 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting']['tx_crawler'] = |
| 52 | - TsfeHook::class . '->fe_isOutputting'; |
|
| 52 | + TsfeHook::class.'->fe_isOutputting'; |
|
| 53 | 53 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['tx_crawler'] = |
| 54 | - TsfeHook::class . '->fe_eofe'; |
|
| 54 | + TsfeHook::class.'->fe_eofe'; |
|
| 55 | 55 | |
| 56 | 56 | // Activating NC Static File Cache hook |
| 57 | 57 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['nc_staticfilecache/class.tx_ncstaticfilecache.php']['createFile_initializeVariables']['tx_crawler'] = |
| 58 | - StaticFileCacheCreateUriHook::class . '->initialize'; |
|
| 58 | + StaticFileCacheCreateUriHook::class.'->initialize'; |
|
| 59 | 59 | |
| 60 | 60 | // Activating Crawler cli_hooks |
| 61 | 61 | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extKey]['cli_hooks'][] = |
@@ -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 === '/') { |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | $results = $this->getDatabaseConnection()->exec_SELECTgetRows( |
| 71 | 71 | 'process_id, system_process_id', |
| 72 | 72 | 'tx_crawler_process', |
| 73 | - 'ttl <= ' . intval(time() - $this->extensionSettings['processMaxRunTime'] - 3600) . ' AND active = 1' |
|
| 73 | + 'ttl <= '.intval(time() - $this->extensionSettings['processMaxRunTime'] - 3600).' AND active = 1' |
|
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | if (!is_array($results)) { |
| 77 | 77 | return; |
| 78 | 78 | } |
| 79 | 79 | foreach ($results as $result) { |
| 80 | - $systemProcessId = (int)$result['system_process_id']; |
|
| 80 | + $systemProcessId = (int) $result['system_process_id']; |
|
| 81 | 81 | $processId = $result['process_id']; |
| 82 | 82 | if ($systemProcessId > 1) { |
| 83 | 83 | if ($this->doProcessStillExists($systemProcessId)) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $results = $this->getDatabaseConnection()->exec_SELECTgetRows( |
| 99 | 99 | 'process_id, system_process_id', |
| 100 | 100 | 'tx_crawler_process', |
| 101 | - 'ttl <= ' . intval(time() - $this->extensionSettings['processMaxRunTime']) . ' AND active = 1' |
|
| 101 | + 'ttl <= '.intval(time() - $this->extensionSettings['processMaxRunTime']).' AND active = 1' |
|
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | if (!is_array($results)) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | foreach ($results as $result) { |
| 108 | 108 | $processExists = false; |
| 109 | - $systemProcessId = (int)$result['system_process_id']; |
|
| 109 | + $systemProcessId = (int) $result['system_process_id']; |
|
| 110 | 110 | $processId = $result['process_id']; |
| 111 | 111 | if ($systemProcessId > 1) { |
| 112 | 112 | $dispatcherProcesses = $this->findDispatcherProcesses(); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | foreach ($dispatcherProcesses as $process) { |
| 118 | 118 | $responseArray = $this->createResponseArray($process); |
| 119 | - if ($systemProcessId === (int)$responseArray[1]) { |
|
| 119 | + if ($systemProcessId === (int) $responseArray[1]) { |
|
| 120 | 120 | $processExists = true; |
| 121 | 121 | }; |
| 122 | 122 | } |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $this->getDatabaseConnection()->exec_DELETEquery( |
| 140 | 140 | 'tx_crawler_process', |
| 141 | - 'process_id = ' . $this->getDatabaseConnection()->fullQuoteStr($processId, 'tx_crawler_process') |
|
| 141 | + 'process_id = '.$this->getDatabaseConnection()->fullQuoteStr($processId, 'tx_crawler_process') |
|
| 142 | 142 | ); |
| 143 | 143 | |
| 144 | 144 | $this->getDatabaseConnection()->exec_UPDATEquery( |
| 145 | 145 | 'tx_crawler_queue', |
| 146 | - 'process_id = ' . $this->getDatabaseConnection()->fullQuoteStr($processId, 'tx_crawler_queue'), |
|
| 146 | + 'process_id = '.$this->getDatabaseConnection()->fullQuoteStr($processId, 'tx_crawler_queue'), |
|
| 147 | 147 | ['process_id' => ''] |
| 148 | 148 | ); |
| 149 | 149 | } |
@@ -177,12 +177,12 @@ discard block |
||
| 177 | 177 | $doProcessStillExists = false; |
| 178 | 178 | if (!$this->isOsWindows()) { |
| 179 | 179 | // Not windows |
| 180 | - if (file_exists('/proc/' . $pid)) { |
|
| 180 | + if (file_exists('/proc/'.$pid)) { |
|
| 181 | 181 | $doProcessStillExists = true; |
| 182 | 182 | } |
| 183 | 183 | } else { |
| 184 | 184 | // Windows |
| 185 | - exec('tasklist | find "' . $pid . '"', $returnArray, $returnValue); |
|
| 185 | + exec('tasklist | find "'.$pid.'"', $returnArray, $returnValue); |
|
| 186 | 186 | if (count($returnArray) > 0 && preg_match('/php/i', $returnValue[0])) { |
| 187 | 187 | $doProcessStillExists = true; |
| 188 | 188 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | posix_kill($pid, 9); |
| 205 | 205 | } else { |
| 206 | 206 | // Windows |
| 207 | - exec('taskkill /PID ' . $pid); |
|
| 207 | + exec('taskkill /PID '.$pid); |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
@@ -59,10 +59,10 @@ |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $fieldId = 'mode'; |
| 62 | - $fieldCode = '<select name="tx_scheduler[mode]" id="' . $fieldId . '" value="' . htmlentities($taskInfo['mode']) . '" class="form-control">' |
|
| 63 | - . '<option value="all"' . ($taskInfo['mode'] == 'all' ? ' selected="selected"' : '') . '>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_flush.modeAll') . '</option>' |
|
| 64 | - . '<option value="finished"' . ($taskInfo['mode'] == 'finished' ? ' selected="selected"' : '') . '>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_flush.modeFinished') . '</option>' |
|
| 65 | - . '<option value="pending"' . ($taskInfo['mode'] == 'pending' ? ' selected="selected"' : '') . '>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_flush.modePending') . '</option>' |
|
| 62 | + $fieldCode = '<select name="tx_scheduler[mode]" id="'.$fieldId.'" value="'.htmlentities($taskInfo['mode']).'" class="form-control">' |
|
| 63 | + . '<option value="all"'.($taskInfo['mode'] == 'all' ? ' selected="selected"' : '').'>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_flush.modeAll').'</option>' |
|
| 64 | + . '<option value="finished"'.($taskInfo['mode'] == 'finished' ? ' selected="selected"' : '').'>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_flush.modeFinished').'</option>' |
|
| 65 | + . '<option value="pending"'.($taskInfo['mode'] == 'pending' ? ' selected="selected"' : '').'>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_flush.modePending').'</option>' |
|
| 66 | 66 | . '</select>'; |
| 67 | 67 | |
| 68 | 68 | $additionalFields[$fieldId] = [ |