@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | // input for timeOut |
| 65 | 65 | $fieldId = 'task_timeOut'; |
| 66 | - $fieldCode = '<input type="text" name="tx_scheduler[timeOut]" id="' . $fieldId . '" value="' . htmlentities($taskInfo['timeOut']) . '" />'; |
|
| 66 | + $fieldCode = '<input type="text" name="tx_scheduler[timeOut]" id="'.$fieldId.'" value="'.htmlentities($taskInfo['timeOut']).'" />'; |
|
| 67 | 67 | $additionalFields[$fieldId] = array( |
| 68 | 68 | 'code' => $fieldCode, |
| 69 | 69 | 'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_im.timeOut' |
@@ -83,21 +83,21 @@ |
||
| 83 | 83 | |
| 84 | 84 | // input for sleepTime |
| 85 | 85 | $fieldId = 'task_sleepTime'; |
| 86 | - $fieldCode = '<input type="text" name="tx_scheduler[sleepTime]" id="' . $fieldId . '" value="' . htmlentities($taskInfo['sleepTime']) . '" />'; |
|
| 86 | + $fieldCode = '<input type="text" name="tx_scheduler[sleepTime]" id="'.$fieldId.'" value="'.htmlentities($taskInfo['sleepTime']).'" />'; |
|
| 87 | 87 | $additionalFields[$fieldId] = array( |
| 88 | 88 | 'code' => $fieldCode, |
| 89 | 89 | 'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_im.sleepTime' |
| 90 | 90 | ); |
| 91 | 91 | // input for sleepAfterFinish |
| 92 | 92 | $fieldId = 'task_sleepAfterFinish'; |
| 93 | - $fieldCode = '<input type="text" name="tx_scheduler[sleepAfterFinish]" id="' . $fieldId . '" value="' . htmlentities($taskInfo['sleepAfterFinish']) . '" />'; |
|
| 93 | + $fieldCode = '<input type="text" name="tx_scheduler[sleepAfterFinish]" id="'.$fieldId.'" value="'.htmlentities($taskInfo['sleepAfterFinish']).'" />'; |
|
| 94 | 94 | $additionalFields[$fieldId] = array( |
| 95 | 95 | 'code' => $fieldCode, |
| 96 | 96 | 'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_im.sleepAfterFinish' |
| 97 | 97 | ); |
| 98 | 98 | // input for countInARun |
| 99 | 99 | $fieldId = 'task_countInARun'; |
| 100 | - $fieldCode = '<input type="text" name="tx_scheduler[countInARun]" id="' . $fieldId . '" value="' . htmlentities($taskInfo['countInARun']) . '" />'; |
|
| 100 | + $fieldCode = '<input type="text" name="tx_scheduler[countInARun]" id="'.$fieldId.'" value="'.htmlentities($taskInfo['countInARun']).'" />'; |
|
| 101 | 101 | $additionalFields[$fieldId] = array( |
| 102 | 102 | 'code' => $fieldCode, |
| 103 | 103 | 'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_im.countInARun' |
@@ -178,8 +178,7 @@ |
||
| 178 | 178 | $completePath = '(' .escapeshellcmd($this->getCrawlerCliPath()) . ' &) > /dev/null'; |
| 179 | 179 | if (system($completePath) === FALSE) { |
| 180 | 180 | throw new Exception('could not start process!'); |
| 181 | - } |
|
| 182 | - else { |
|
| 181 | + } else { |
|
| 183 | 182 | for ($i=0;$i<10;$i++) { |
| 184 | 183 | if ($this->processRepository->countNotTimeouted($ttl) > $current) { |
| 185 | 184 | return true; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * Manages cralwer processes and can be used to start a new process or multiple processes |
| 27 | 27 | * |
| 28 | 28 | */ |
| 29 | -class tx_crawler_domain_process_manager { |
|
| 29 | +class tx_crawler_domain_process_manager { |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @var $timeToLive integer |
@@ -83,22 +83,22 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @throws RuntimeException |
| 85 | 85 | */ |
| 86 | - public function multiProcess( $timeout ) { |
|
| 86 | + public function multiProcess($timeout) { |
|
| 87 | 87 | |
| 88 | 88 | if ($this->processLimit <= 1) { |
| 89 | - throw new RuntimeException('To run crawler in multi process mode you have to configure the processLimit > 1.' . PHP_EOL); |
|
| 89 | + throw new RuntimeException('To run crawler in multi process mode you have to configure the processLimit > 1.'.PHP_EOL); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $pendingItemsStart = $this->queueRepository->countAllPendingItems(); |
| 93 | 93 | $itemReportLimit = 20; |
| 94 | - $reportItemCount = $pendingItemsStart - $itemReportLimit; |
|
| 94 | + $reportItemCount = $pendingItemsStart - $itemReportLimit; |
|
| 95 | 95 | if ($this->verbose) { |
| 96 | 96 | $this->reportItemStatus(); |
| 97 | 97 | } |
| 98 | 98 | $this->startRequiredProcesses(); |
| 99 | 99 | $nextTimeOut = time() + $this->timeToLive; |
| 100 | 100 | $currentPendingItems = ''; |
| 101 | - for ($i=0; $i<$timeout; $i++) { |
|
| 101 | + for ($i = 0; $i < $timeout; $i++) { |
|
| 102 | 102 | $currentPendingItems = $this->queueRepository->countAllPendingItems(); |
| 103 | 103 | if ($this->startRequiredProcesses()) { |
| 104 | 104 | $nextTimeOut = time() + $this->timeToLive; |
@@ -113,16 +113,16 @@ discard block |
||
| 113 | 113 | if ($this->verbose) { |
| 114 | 114 | $this->reportItemStatus(); |
| 115 | 115 | } |
| 116 | - $reportItemCount = $currentPendingItems - $itemReportLimit; |
|
| 116 | + $reportItemCount = $currentPendingItems - $itemReportLimit; |
|
| 117 | 117 | } |
| 118 | 118 | sleep(1); |
| 119 | 119 | if ($nextTimeOut < time()) { |
| 120 | - $timedOutProcesses = $this->processRepository->findAll('','DESC',NULL,0,'ttl >'.$nextTimeOut); |
|
| 120 | + $timedOutProcesses = $this->processRepository->findAll('', 'DESC', NULL, 0, 'ttl >'.$nextTimeOut); |
|
| 121 | 121 | $nextTimeOut = time() + $this->timeToLive; |
| 122 | 122 | if ($this->verbose) { |
| 123 | - echo 'Cleanup'.implode(',',$timedOutProcesses->getProcessIds()).chr(10); |
|
| 123 | + echo 'Cleanup'.implode(',', $timedOutProcesses->getProcessIds()).chr(10); |
|
| 124 | 124 | } |
| 125 | - $this->crawlerObj->CLI_releaseProcesses($timedOutProcesses->getProcessIds(),true); |
|
| 125 | + $this->crawlerObj->CLI_releaseProcesses($timedOutProcesses->getProcessIds(), true); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | if ($currentPendingItems > 0 && $this->verbose) { |
@@ -144,17 +144,17 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | private function startRequiredProcesses() { |
| 146 | 146 | $ret = FALSE; |
| 147 | - $currentProcesses= $this->processRepository->countActive(); |
|
| 148 | - $availableProcessesCount = $this->processLimit-$currentProcesses; |
|
| 147 | + $currentProcesses = $this->processRepository->countActive(); |
|
| 148 | + $availableProcessesCount = $this->processLimit - $currentProcesses; |
|
| 149 | 149 | $requiredProcessesCount = ceil($this->queueRepository->countAllUnassignedPendingItems() / $this->countInARun); |
| 150 | - $startProcessCount = min(array($availableProcessesCount,$requiredProcessesCount)); |
|
| 150 | + $startProcessCount = min(array($availableProcessesCount, $requiredProcessesCount)); |
|
| 151 | 151 | if ($startProcessCount <= 0) { |
| 152 | 152 | return $ret; |
| 153 | 153 | } |
| 154 | 154 | if ($startProcessCount && $this->verbose) { |
| 155 | 155 | echo 'Start '.$startProcessCount.' new processes (Running:'.$currentProcesses.')'; |
| 156 | 156 | } |
| 157 | - for($i=0;$i<$startProcessCount;$i++) { |
|
| 157 | + for ($i = 0; $i < $startProcessCount; $i++) { |
|
| 158 | 158 | usleep(100); |
| 159 | 159 | if ($this->startProcess()) { |
| 160 | 160 | if ($this->verbose) { |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | * @throws Exception if no crawlerprocess was started |
| 175 | 175 | */ |
| 176 | 176 | public function startProcess() { |
| 177 | - $ttl = (time() + $this->timeToLive -1); |
|
| 177 | + $ttl = (time() + $this->timeToLive - 1); |
|
| 178 | 178 | $current = $this->processRepository->countNotTimeouted($ttl); |
| 179 | - $completePath = '(' .escapeshellcmd($this->getCrawlerCliPath()) . ' &) > /dev/null'; |
|
| 179 | + $completePath = '('.escapeshellcmd($this->getCrawlerCliPath()).' &) > /dev/null'; |
|
| 180 | 180 | if (system($completePath) === FALSE) { |
| 181 | 181 | throw new Exception('could not start process!'); |
| 182 | 182 | } |
| 183 | 183 | else { |
| 184 | - for ($i=0;$i<10;$i++) { |
|
| 184 | + for ($i = 0; $i < 10; $i++) { |
|
| 185 | 185 | if ($this->processRepository->countNotTimeouted($ttl) > $current) { |
| 186 | 186 | return true; |
| 187 | 187 | } |
@@ -196,10 +196,10 @@ discard block |
||
| 196 | 196 | * |
| 197 | 197 | * @return string |
| 198 | 198 | */ |
| 199 | - public function getCrawlerCliPath(){ |
|
| 200 | - $phpPath = $this->crawlerObj->extensionSettings['phpPath'] . ' '; |
|
| 199 | + public function getCrawlerCliPath() { |
|
| 200 | + $phpPath = $this->crawlerObj->extensionSettings['phpPath'].' '; |
|
| 201 | 201 | $pathToTypo3 = rtrim(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT'), '/'); |
| 202 | - $pathToTypo3 .= rtrim(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), '/'); |
|
| 202 | + $pathToTypo3 .= rtrim(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), '/'); |
|
| 203 | 203 | $cliPart = '/typo3/cli_dispatch.phpsh crawler'; |
| 204 | 204 | return $phpPath.$pathToTypo3.$cliPart; |
| 205 | 205 | } |
@@ -24,36 +24,36 @@ |
||
| 24 | 24 | |
| 25 | 25 | abstract class tx_crawler_domain_lib_abstract_repository { |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @var string object class name |
|
| 29 | - */ |
|
| 30 | - protected $objectClassname; |
|
| 27 | + /** |
|
| 28 | + * @var string object class name |
|
| 29 | + */ |
|
| 30 | + protected $objectClassname; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @var string table name |
|
| 34 | - */ |
|
| 35 | - protected $tableName; |
|
| 32 | + /** |
|
| 33 | + * @var string table name |
|
| 34 | + */ |
|
| 35 | + protected $tableName; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Returns an instance of the TYPO3 database class. |
|
| 39 | - * |
|
| 40 | - * @return \TYPO3\CMS\Core\Database\DatabaseConnection |
|
| 41 | - */ |
|
| 42 | - protected function getDB() { |
|
| 43 | - return $GLOBALS['TYPO3_DB']; |
|
| 44 | - } |
|
| 37 | + /** |
|
| 38 | + * Returns an instance of the TYPO3 database class. |
|
| 39 | + * |
|
| 40 | + * @return \TYPO3\CMS\Core\Database\DatabaseConnection |
|
| 41 | + */ |
|
| 42 | + protected function getDB() { |
|
| 43 | + return $GLOBALS['TYPO3_DB']; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Counts items by a given where clause |
|
| 48 | - * |
|
| 49 | - * @param string $where Where clause |
|
| 50 | - * @return integer |
|
| 51 | - */ |
|
| 52 | - protected function countByWhere($where) { |
|
| 53 | - $db = $this->getDB(); |
|
| 54 | - $rs = $db->exec_SELECTquery('count(*) as anz', $this->tableName, $where); |
|
| 55 | - $res = $db->sql_fetch_assoc($rs); |
|
| 46 | + /** |
|
| 47 | + * Counts items by a given where clause |
|
| 48 | + * |
|
| 49 | + * @param string $where Where clause |
|
| 50 | + * @return integer |
|
| 51 | + */ |
|
| 52 | + protected function countByWhere($where) { |
|
| 53 | + $db = $this->getDB(); |
|
| 54 | + $rs = $db->exec_SELECTquery('count(*) as anz', $this->tableName, $where); |
|
| 55 | + $res = $db->sql_fetch_assoc($rs); |
|
| 56 | 56 | |
| 57 | - return $res['anz']; |
|
| 58 | - } |
|
| 57 | + return $res['anz']; |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -24,97 +24,97 @@ |
||
| 24 | 24 | |
| 25 | 25 | class tx_crawler_domain_process_repository extends tx_crawler_domain_lib_abstract_repository { |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @var string object class name |
|
| 29 | - */ |
|
| 30 | - protected $objectClassname = 'tx_crawler_domain_process'; |
|
| 27 | + /** |
|
| 28 | + * @var string object class name |
|
| 29 | + */ |
|
| 30 | + protected $objectClassname = 'tx_crawler_domain_process'; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 35 | - protected $tableName = 'tx_crawler_process'; |
|
| 32 | + /** |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | + protected $tableName = 'tx_crawler_process'; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * This method is used to find all cli processes within a limit. |
|
| 39 | - * |
|
| 40 | - * @param string $orderField |
|
| 41 | - * @param string $orderDirection |
|
| 42 | - * @param integer $itemCount |
|
| 43 | - * @param integer $offset |
|
| 44 | - * @param string $where |
|
| 45 | - * @return tx_crawler_domain_process_collection |
|
| 46 | - */ |
|
| 47 | - public function findAll($orderField = '', $orderDirection = 'DESC', $itemCount = NULL, $offset = NULL, $where = '') { |
|
| 48 | - /** @var tx_crawler_domain_process_collection $collection */ |
|
| 49 | - $collection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_domain_process_collection'); |
|
| 37 | + /** |
|
| 38 | + * This method is used to find all cli processes within a limit. |
|
| 39 | + * |
|
| 40 | + * @param string $orderField |
|
| 41 | + * @param string $orderDirection |
|
| 42 | + * @param integer $itemCount |
|
| 43 | + * @param integer $offset |
|
| 44 | + * @param string $where |
|
| 45 | + * @return tx_crawler_domain_process_collection |
|
| 46 | + */ |
|
| 47 | + public function findAll($orderField = '', $orderDirection = 'DESC', $itemCount = NULL, $offset = NULL, $where = '') { |
|
| 48 | + /** @var tx_crawler_domain_process_collection $collection */ |
|
| 49 | + $collection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_domain_process_collection'); |
|
| 50 | 50 | |
| 51 | - $orderField = trim($orderField); |
|
| 52 | - $orderField = empty($orderField) ? 'process_id' : $orderField; |
|
| 51 | + $orderField = trim($orderField); |
|
| 52 | + $orderField = empty($orderField) ? 'process_id' : $orderField; |
|
| 53 | 53 | |
| 54 | - $orderDirection = strtoupper(trim($orderDirection)); |
|
| 55 | - $orderDirection = in_array($orderDirection, array('ASC', 'DESC')) ? $orderDirection : 'DESC'; |
|
| 54 | + $orderDirection = strtoupper(trim($orderDirection)); |
|
| 55 | + $orderDirection = in_array($orderDirection, array('ASC', 'DESC')) ? $orderDirection : 'DESC'; |
|
| 56 | 56 | |
| 57 | - $rows = $this->getDB()->exec_SELECTgetRows( |
|
| 58 | - '*', |
|
| 59 | - $this->tableName, |
|
| 60 | - $where, |
|
| 61 | - '', |
|
| 62 | - htmlspecialchars($orderField) . ' ' . htmlspecialchars($orderDirection), |
|
| 63 | - self::getLimitFromItemCountAndOffset($itemCount, $offset) |
|
| 64 | - ); |
|
| 57 | + $rows = $this->getDB()->exec_SELECTgetRows( |
|
| 58 | + '*', |
|
| 59 | + $this->tableName, |
|
| 60 | + $where, |
|
| 61 | + '', |
|
| 62 | + htmlspecialchars($orderField) . ' ' . htmlspecialchars($orderDirection), |
|
| 63 | + self::getLimitFromItemCountAndOffset($itemCount, $offset) |
|
| 64 | + ); |
|
| 65 | 65 | |
| 66 | - if (is_array($rows)) { |
|
| 67 | - foreach($rows as $row) { |
|
| 68 | - $collection->append(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($this->objectClassname, $row)); |
|
| 69 | - } |
|
| 70 | - } |
|
| 66 | + if (is_array($rows)) { |
|
| 67 | + foreach($rows as $row) { |
|
| 68 | + $collection->append(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($this->objectClassname, $row)); |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - return $collection; |
|
| 73 | - } |
|
| 72 | + return $collection; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * This method is used to count all processes in the process table. |
|
| 77 | - * |
|
| 78 | - * @param string $where Where clause |
|
| 79 | - * @return integer |
|
| 80 | - * @author Timo Schmidt <[email protected]> |
|
| 81 | - */ |
|
| 82 | - public function countAll($where = '1 = 1') { |
|
| 83 | - return $this->countByWhere($where); |
|
| 84 | - } |
|
| 75 | + /** |
|
| 76 | + * This method is used to count all processes in the process table. |
|
| 77 | + * |
|
| 78 | + * @param string $where Where clause |
|
| 79 | + * @return integer |
|
| 80 | + * @author Timo Schmidt <[email protected]> |
|
| 81 | + */ |
|
| 82 | + public function countAll($where = '1 = 1') { |
|
| 83 | + return $this->countByWhere($where); |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Returns the number of active processes. |
|
| 88 | - * |
|
| 89 | - * @return integer |
|
| 90 | - */ |
|
| 91 | - public function countActive() { |
|
| 92 | - return $this->countByWhere('active = 1 AND deleted = 0'); |
|
| 93 | - } |
|
| 86 | + /** |
|
| 87 | + * Returns the number of active processes. |
|
| 88 | + * |
|
| 89 | + * @return integer |
|
| 90 | + */ |
|
| 91 | + public function countActive() { |
|
| 92 | + return $this->countByWhere('active = 1 AND deleted = 0'); |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * Returns the number of processes that live longer than the given timestamp. |
|
| 97 | - * |
|
| 98 | - * @param integer $ttl |
|
| 99 | - * @return integer |
|
| 100 | - */ |
|
| 101 | - public function countNotTimeouted($ttl) { |
|
| 102 | - return $this->countByWhere('deleted = 0 AND ttl > ' . intval($ttl)); |
|
| 103 | - } |
|
| 95 | + /** |
|
| 96 | + * Returns the number of processes that live longer than the given timestamp. |
|
| 97 | + * |
|
| 98 | + * @param integer $ttl |
|
| 99 | + * @return integer |
|
| 100 | + */ |
|
| 101 | + public function countNotTimeouted($ttl) { |
|
| 102 | + return $this->countByWhere('deleted = 0 AND ttl > ' . intval($ttl)); |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Get limit clause |
|
| 107 | - * |
|
| 108 | - * @param integer $itemCount Item count |
|
| 109 | - * @param integer $offset Offset |
|
| 110 | - * @return string Limit clause |
|
| 111 | - * @author Fabrizio Branca <[email protected]> |
|
| 112 | - */ |
|
| 113 | - public static function getLimitFromItemCountAndOffset($itemCount, $offset) { |
|
| 114 | - $itemCount = filter_var($itemCount, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1, 'default' => 20))); |
|
| 115 | - $offset = filter_var($offset, FILTER_VALIDATE_INT, array('options' => array('min_range' => 0, 'default' => 0))); |
|
| 116 | - $limit = $offset . ', ' . $itemCount; |
|
| 105 | + /** |
|
| 106 | + * Get limit clause |
|
| 107 | + * |
|
| 108 | + * @param integer $itemCount Item count |
|
| 109 | + * @param integer $offset Offset |
|
| 110 | + * @return string Limit clause |
|
| 111 | + * @author Fabrizio Branca <[email protected]> |
|
| 112 | + */ |
|
| 113 | + public static function getLimitFromItemCountAndOffset($itemCount, $offset) { |
|
| 114 | + $itemCount = filter_var($itemCount, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1, 'default' => 20))); |
|
| 115 | + $offset = filter_var($offset, FILTER_VALIDATE_INT, array('options' => array('min_range' => 0, 'default' => 0))); |
|
| 116 | + $limit = $offset . ', ' . $itemCount; |
|
| 117 | 117 | |
| 118 | - return $limit; |
|
| 119 | - } |
|
| 118 | + return $limit; |
|
| 119 | + } |
|
| 120 | 120 | } |
@@ -59,12 +59,12 @@ discard block |
||
| 59 | 59 | $this->tableName, |
| 60 | 60 | $where, |
| 61 | 61 | '', |
| 62 | - htmlspecialchars($orderField) . ' ' . htmlspecialchars($orderDirection), |
|
| 62 | + htmlspecialchars($orderField).' '.htmlspecialchars($orderDirection), |
|
| 63 | 63 | self::getLimitFromItemCountAndOffset($itemCount, $offset) |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | if (is_array($rows)) { |
| 67 | - foreach($rows as $row) { |
|
| 67 | + foreach ($rows as $row) { |
|
| 68 | 68 | $collection->append(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($this->objectClassname, $row)); |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @return integer |
| 100 | 100 | */ |
| 101 | 101 | public function countNotTimeouted($ttl) { |
| 102 | - return $this->countByWhere('deleted = 0 AND ttl > ' . intval($ttl)); |
|
| 102 | + return $this->countByWhere('deleted = 0 AND ttl > '.intval($ttl)); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | public static function getLimitFromItemCountAndOffset($itemCount, $offset) { |
| 114 | 114 | $itemCount = filter_var($itemCount, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1, 'default' => 20))); |
| 115 | 115 | $offset = filter_var($offset, FILTER_VALIDATE_INT, array('options' => array('min_range' => 0, 'default' => 0))); |
| 116 | - $limit = $offset . ', ' . $itemCount; |
|
| 116 | + $limit = $offset.', '.$itemCount; |
|
| 117 | 117 | |
| 118 | 118 | return $limit; |
| 119 | 119 | } |
@@ -203,23 +203,23 @@ discard block |
||
| 203 | 203 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
| 204 | 204 | |
| 205 | 205 | $h_func .= '<hr/>' . |
| 206 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, |
|
| 206 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, |
|
| 207 | 207 | 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], |
| 208 | 208 | 'index.php', '&setID=' . $setId) . ' - ' . |
| 209 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 209 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 210 | 210 | 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', |
| 211 | 211 | '&setID=' . $setId . $quiPart) . ' - ' . |
| 212 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 212 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 213 | 213 | 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', |
| 214 | 214 | '&setID=' . $setId . $quiPart) . ' - ' . |
| 215 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage') . ': ' . |
|
| 216 | - \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
|
| 217 | - $this->pObj->id, |
|
| 218 | - 'SET[itemsPerPage]', |
|
| 219 | - $this->pObj->MOD_SETTINGS['itemsPerPage'], |
|
| 220 | - $this->pObj->MOD_MENU['itemsPerPage'], |
|
| 221 | - 'index.php' |
|
| 222 | - ); |
|
| 215 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage') . ': ' . |
|
| 216 | + \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu( |
|
| 217 | + $this->pObj->id, |
|
| 218 | + 'SET[itemsPerPage]', |
|
| 219 | + $this->pObj->MOD_SETTINGS['itemsPerPage'], |
|
| 220 | + $this->pObj->MOD_MENU['itemsPerPage'], |
|
| 221 | + 'index.php' |
|
| 222 | + ); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $theOutput = $this->pObj->doc->spacer(5); |
@@ -353,9 +353,9 @@ discard block |
||
| 353 | 353 | time()) . '<br />'; |
| 354 | 354 | $output .= '<br /> |
| 355 | 355 | <table class="lrPadding c-list url-table">' . |
| 356 | - $this->drawURLs_printTableHeader() . |
|
| 357 | - $code . |
|
| 358 | - '</table>'; |
|
| 356 | + $this->drawURLs_printTableHeader() . |
|
| 357 | + $code . |
|
| 358 | + '</table>'; |
|
| 359 | 359 | } else { |
| 360 | 360 | $output .= count(array_keys($this->duplicateTrack)) . ' ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted') . '. <br /><br />'; |
| 361 | 361 | $output .= '<input type="submit" name="_" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue') . '" />'; |
@@ -546,8 +546,8 @@ discard block |
||
| 546 | 546 | <input type="hidden" value="' . $showSetId . '" name="setID" /> |
| 547 | 547 | <br /> |
| 548 | 548 | Current server time: ' . date('H:i:s', time()) . '<br />' . |
| 549 | - 'Status: ' . $resStatus . '<br />' . |
|
| 550 | - \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
|
| 549 | + 'Status: ' . $resStatus . '<br />' . |
|
| 550 | + \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
|
| 551 | 551 | } else { // Show list: |
| 552 | 552 | |
| 553 | 553 | // If either id or set id, show list: |
@@ -609,9 +609,9 @@ discard block |
||
| 609 | 609 | |
| 610 | 610 | |
| 611 | 611 | <table class="lrPadding c-list crawlerlog">' . |
| 612 | - $this->drawLog_printTableHeader() . |
|
| 613 | - $code . |
|
| 614 | - '</table>'; |
|
| 612 | + $this->drawLog_printTableHeader() . |
|
| 613 | + $code . |
|
| 614 | + '</table>'; |
|
| 615 | 615 | } |
| 616 | 616 | } else { // Otherwise show available sets: |
| 617 | 617 | $setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( |
@@ -646,8 +646,8 @@ discard block |
||
| 646 | 646 | $output .= ' |
| 647 | 647 | <br /><br /> |
| 648 | 648 | <table class="lrPadding c-list">' . |
| 649 | - $code . |
|
| 650 | - '</table>'; |
|
| 649 | + $code . |
|
| 650 | + '</table>'; |
|
| 651 | 651 | } |
| 652 | 652 | } |
| 653 | 653 | |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle') . ':</td> |
| 867 | 867 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid') . ':</td> |
| 868 | 868 | <td> </td>' . |
| 869 | - ($this->pObj->MOD_SETTINGS['log_resultLog'] ? ' |
|
| 869 | + ($this->pObj->MOD_SETTINGS['log_resultLog'] ? ' |
|
| 870 | 870 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog') . ':</td>' : ' |
| 871 | 871 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime') . ':</td> |
| 872 | 872 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime') . ':</td>') . ' |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups') . ':</td> |
| 876 | 876 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr') . ':</td> |
| 877 | 877 | <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td>' . |
| 878 | - ($this->pObj->MOD_SETTINGS['log_feVars'] ? ' |
|
| 878 | + ($this->pObj->MOD_SETTINGS['log_feVars'] ? ' |
|
| 879 | 879 | <td>' . htmlspecialchars('TSFE->id') . '</td> |
| 880 | 880 | <td>' . htmlspecialchars('TSFE->gr_list') . '</td> |
| 881 | 881 | <td>' . htmlspecialchars('TSFE->no_cache') . '</td>' : '') . ' |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | white-space: nowrap; vertical-align: top; |
| 177 | 177 | } |
| 178 | 178 | --></style> |
| 179 | - <link rel="stylesheet" type="text/css" href="' . $BACK_PATH . '../typo3conf/ext/crawler/template/res.css" /> |
|
| 179 | + <link rel="stylesheet" type="text/css" href="' . $BACK_PATH.'../typo3conf/ext/crawler/template/res.css" /> |
|
| 180 | 180 | '; |
| 181 | 181 | |
| 182 | 182 | // Type function menu: |
@@ -198,21 +198,21 @@ discard block |
||
| 198 | 198 | 'index.php' |
| 199 | 199 | ); |
| 200 | 200 | |
| 201 | - $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
| 201 | + $quiPart = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details') ? '&qid_details='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) : ''; |
|
| 202 | 202 | |
| 203 | 203 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
| 204 | 204 | |
| 205 | - $h_func .= '<hr/>' . |
|
| 206 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, |
|
| 205 | + $h_func .= '<hr/>'. |
|
| 206 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, |
|
| 207 | 207 | 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], |
| 208 | - 'index.php', '&setID=' . $setId) . ' - ' . |
|
| 209 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 208 | + 'index.php', '&setID='.$setId).' - '. |
|
| 209 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 210 | 210 | 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', |
| 211 | - '&setID=' . $setId . $quiPart) . ' - ' . |
|
| 212 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars') . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 211 | + '&setID='.$setId.$quiPart).' - '. |
|
| 212 | + $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars').': '.\TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, |
|
| 213 | 213 | 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', |
| 214 | - '&setID=' . $setId . $quiPart) . ' - ' . |
|
| 215 | - $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage') . ': ' . |
|
| 214 | + '&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]', |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $h_func, false, true); |
| 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 | $this->downloadCrawlUrls = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_download'); |
| 275 | 275 | $this->makeCrawlerProcessableChecks(); |
| 276 | 276 | |
| 277 | - switch ((string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
| 277 | + switch ((string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tstamp')) { |
|
| 278 | 278 | case 'midnight': |
| 279 | 279 | $this->scheduledTime = mktime(0, 0, 0); |
| 280 | 280 | break; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | ) { |
| 304 | 304 | $code = ' |
| 305 | 305 | <tr> |
| 306 | - <td colspan="7"><b>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected') . '</b></td> |
|
| 306 | + <td colspan="7"><b>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noConfigSelected').'</b></td> |
|
| 307 | 307 | </tr>'; |
| 308 | 308 | } else { |
| 309 | 309 | if ($this->submitCrawlUrls) { |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | if ($BE_USER instanceof \TYPO3\CMS\Core\Authentication\BackendUserAuthentication) { |
| 314 | 314 | $username = $BE_USER->user['username']; |
| 315 | - $reason->setDetailText('The user ' . $username . ' added pages to the crawler queue manually '); |
|
| 315 | + $reason->setDetailText('The user '.$username.' added pages to the crawler queue manually '); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | tx_crawler_domain_events_dispatcher::getInstance()->post('invokeQueueChange', |
@@ -340,26 +340,26 @@ discard block |
||
| 340 | 340 | $output = ''; |
| 341 | 341 | if ($code) { |
| 342 | 342 | |
| 343 | - $output .= '<h3>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration') . ':</h3>'; |
|
| 344 | - $output .= '<input type="hidden" name="id" value="' . intval($this->pObj->id) . '" />'; |
|
| 345 | - |
|
| 346 | - if ( ! $this->submitCrawlUrls) { |
|
| 347 | - $output .= $this->drawURLs_cfgSelectors() . '<br />'; |
|
| 348 | - $output .= '<input type="submit" name="_update" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate') . '" /> '; |
|
| 349 | - $output .= '<input type="submit" name="_crawl" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl') . '" /> '; |
|
| 350 | - $output .= '<input type="submit" name="_download" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload') . '" /><br /><br />'; |
|
| 351 | - $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count') . ': ' . count(array_keys($this->duplicateTrack)) . '<br />'; |
|
| 352 | - $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime') . ': ' . date('H:i:s', |
|
| 353 | - time()) . '<br />'; |
|
| 343 | + $output .= '<h3>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configuration').':</h3>'; |
|
| 344 | + $output .= '<input type="hidden" name="id" value="'.intval($this->pObj->id).'" />'; |
|
| 345 | + |
|
| 346 | + if (!$this->submitCrawlUrls) { |
|
| 347 | + $output .= $this->drawURLs_cfgSelectors().'<br />'; |
|
| 348 | + $output .= '<input type="submit" name="_update" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerUpdate').'" /> '; |
|
| 349 | + $output .= '<input type="submit" name="_crawl" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerCrawl').'" /> '; |
|
| 350 | + $output .= '<input type="submit" name="_download" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.triggerDownload').'" /><br /><br />'; |
|
| 351 | + $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').': '.count(array_keys($this->duplicateTrack)).'<br />'; |
|
| 352 | + $output .= $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', |
|
| 353 | + time()).'<br />'; |
|
| 354 | 354 | $output .= '<br /> |
| 355 | 355 | <table class="lrPadding c-list url-table">' . |
| 356 | - $this->drawURLs_printTableHeader() . |
|
| 357 | - $code . |
|
| 356 | + $this->drawURLs_printTableHeader(). |
|
| 357 | + $code. |
|
| 358 | 358 | '</table>'; |
| 359 | 359 | } else { |
| 360 | - $output .= count(array_keys($this->duplicateTrack)) . ' ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted') . '. <br /><br />'; |
|
| 361 | - $output .= '<input type="submit" name="_" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue') . '" />'; |
|
| 362 | - $output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog') . '" />'; |
|
| 360 | + $output .= count(array_keys($this->duplicateTrack)).' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.submitted').'. <br /><br />'; |
|
| 361 | + $output .= '<input type="submit" name="_" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continue').'" />'; |
|
| 362 | + $output .= '<input type="submit" onclick="this.form.elements[\'SET[crawlaction]\'].value=\'log\';" value="'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.continueinlog').'" />'; |
|
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
@@ -368,11 +368,11 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | // Creating output header: |
| 370 | 370 | $mimeType = 'application/octet-stream'; |
| 371 | - Header('Content-Type: ' . $mimeType); |
|
| 371 | + Header('Content-Type: '.$mimeType); |
|
| 372 | 372 | Header('Content-Disposition: attachment; filename=CrawlerUrls.txt'); |
| 373 | 373 | |
| 374 | 374 | // Printing the content of the CSV lines: |
| 375 | - echo implode(chr(13) . chr(10), $this->downloadUrls); |
|
| 375 | + echo implode(chr(13).chr(10), $this->downloadUrls); |
|
| 376 | 376 | |
| 377 | 377 | // Exits: |
| 378 | 378 | exit; |
@@ -453,13 +453,13 @@ discard block |
||
| 453 | 453 | $output = ' |
| 454 | 454 | <table class="lrPadding c-list"> |
| 455 | 455 | <tr class="bgColor5 tableheader"> |
| 456 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.depth') . ':</td> |
|
| 457 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configurations') . ':</td> |
|
| 458 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduled') . ':</td> |
|
| 456 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.depth').':</td> |
|
| 457 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.configurations').':</td> |
|
| 458 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduled').':</td> |
|
| 459 | 459 | </tr> |
| 460 | 460 | <tr class="bgColor4"> |
| 461 | 461 | <td valign="top">' . implode('</td> |
| 462 | - <td valign="top">', $cell) . '</td> |
|
| 462 | + <td valign="top">', $cell).'</td> |
|
| 463 | 463 | </tr> |
| 464 | 464 | </table>'; |
| 465 | 465 | |
@@ -476,13 +476,13 @@ discard block |
||
| 476 | 476 | |
| 477 | 477 | $content = ' |
| 478 | 478 | <tr class="bgColor5 tableheader"> |
| 479 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle') . ':</td> |
|
| 480 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.key') . ':</td> |
|
| 481 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parametercfg') . ':</td> |
|
| 482 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.values') . ':</td> |
|
| 483 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.urls') . ':</td> |
|
| 484 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.options') . ':</td> |
|
| 485 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parameters') . ':</td> |
|
| 479 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td> |
|
| 480 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.key').':</td> |
|
| 481 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parametercfg').':</td> |
|
| 482 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.values').':</td> |
|
| 483 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.urls').':</td> |
|
| 484 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.options').':</td> |
|
| 485 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.parameters').':</td> |
|
| 486 | 486 | </tr>'; |
| 487 | 487 | |
| 488 | 488 | return $content; |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | // Get entry record: |
| 526 | 526 | list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', |
| 527 | - 'qid=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
| 527 | + 'qid='.intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details'))); |
|
| 528 | 528 | |
| 529 | 529 | // Explode values: |
| 530 | 530 | $resStatus = $this->getResStatus($q_entry); |
@@ -534,19 +534,19 @@ discard block |
||
| 534 | 534 | $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']); |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | - if ( ! $this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
| 537 | + if (!$this->pObj->MOD_SETTINGS['log_resultLog']) { |
|
| 538 | 538 | unset($q_entry['result_data']['content']['log']); |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | // Print rudimentary details: |
| 542 | 542 | $output .= ' |
| 543 | 543 | <br /><br /> |
| 544 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" /> |
|
| 545 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
| 546 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
| 544 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back').'" name="_back" /> |
|
| 545 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
| 546 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
| 547 | 547 | <br /> |
| 548 | - Current server time: ' . date('H:i:s', time()) . '<br />' . |
|
| 549 | - 'Status: ' . $resStatus . '<br />' . |
|
| 548 | + Current server time: ' . date('H:i:s', time()).'<br />'. |
|
| 549 | + 'Status: '.$resStatus.'<br />'. |
|
| 550 | 550 | \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry); |
| 551 | 551 | } else { // Show list: |
| 552 | 552 | |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | // Drawing tree: |
| 557 | 557 | $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Tree\View\PageTreeView'); |
| 558 | 558 | $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| 559 | - $tree->init('AND ' . $perms_clause); |
|
| 559 | + $tree->init('AND '.$perms_clause); |
|
| 560 | 560 | |
| 561 | 561 | // Set root row: |
| 562 | 562 | $HTML = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $this->pObj->pageinfo); |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | foreach ($tree->tree as $data) { |
| 577 | 577 | $code .= $this->drawLog_addRows( |
| 578 | 578 | $data['row'], |
| 579 | - $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', |
|
| 579 | + $data['HTML'].\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', |
|
| 580 | 580 | $data['row'], true), |
| 581 | 581 | intval($this->pObj->MOD_SETTINGS['itemsPerPage']) |
| 582 | 582 | ); |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | $code = ''; |
| 589 | 589 | $code .= $this->drawLog_addRows( |
| 590 | 590 | $showSetId, |
| 591 | - 'Set ID: ' . $showSetId |
|
| 591 | + 'Set ID: '.$showSetId |
|
| 592 | 592 | ); |
| 593 | 593 | } |
| 594 | 594 | |
@@ -596,21 +596,21 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | $output .= ' |
| 598 | 598 | <br /><br /> |
| 599 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist') . '" name="_reload" /> |
|
| 600 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv') . '" name="_csv" /> |
|
| 601 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushvisiblequeue') . '" name="_flush" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" /> |
|
| 602 | - <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushfullqueue') . '" name="_flush_all" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" /> |
|
| 603 | - <input type="hidden" value="' . $this->pObj->id . '" name="id" /> |
|
| 604 | - <input type="hidden" value="' . $showSetId . '" name="setID" /> |
|
| 599 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist').'" name="_reload" /> |
|
| 600 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv').'" name="_csv" /> |
|
| 601 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushvisiblequeue').'" name="_flush" onclick="return confirm(\''.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure').'\');" /> |
|
| 602 | + <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushfullqueue').'" name="_flush_all" onclick="return confirm(\''.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure').'\');" /> |
|
| 603 | + <input type="hidden" value="' . $this->pObj->id.'" name="id" /> |
|
| 604 | + <input type="hidden" value="' . $showSetId.'" name="setID" /> |
|
| 605 | 605 | <br /> |
| 606 | - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime') . ': ' . date('H:i:s', |
|
| 607 | - time()) . ' |
|
| 606 | + ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime').': '.date('H:i:s', |
|
| 607 | + time()).' |
|
| 608 | 608 | <br /><br /> |
| 609 | 609 | |
| 610 | 610 | |
| 611 | 611 | <table class="lrPadding c-list crawlerlog">' . |
| 612 | - $this->drawLog_printTableHeader() . |
|
| 613 | - $code . |
|
| 612 | + $this->drawLog_printTableHeader(). |
|
| 613 | + $code. |
|
| 614 | 614 | '</table>'; |
| 615 | 615 | } |
| 616 | 616 | } else { // Otherwise show available sets: |
@@ -624,19 +624,19 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | $code = ' |
| 626 | 626 | <tr class="bgColor5 tableheader"> |
| 627 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td> |
|
| 628 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count') . 't:</td> |
|
| 629 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time') . ':</td> |
|
| 627 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td> |
|
| 628 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count').'t:</td> |
|
| 629 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time').':</td> |
|
| 630 | 630 | </tr> |
| 631 | 631 | '; |
| 632 | 632 | |
| 633 | 633 | $cc = 0; |
| 634 | 634 | foreach ($setList as $set) { |
| 635 | 635 | $code .= ' |
| 636 | - <tr class="bgColor' . ($cc % 2 ? '-20' : '-10') . '"> |
|
| 637 | - <td><a href="' . htmlspecialchars('index.php?setID=' . $set['set_id']) . '">' . $set['set_id'] . '</a></td> |
|
| 638 | - <td>' . $set['count_value'] . '</td> |
|
| 639 | - <td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']) . '</td> |
|
| 636 | + <tr class="bgColor' . ($cc % 2 ? '-20' : '-10').'"> |
|
| 637 | + <td><a href="' . htmlspecialchars('index.php?setID='.$set['set_id']).'">'.$set['set_id'].'</a></td> |
|
| 638 | + <td>' . $set['count_value'].'</td> |
|
| 639 | + <td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']).'</td> |
|
| 640 | 640 | </tr> |
| 641 | 641 | '; |
| 642 | 642 | |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $output .= ' |
| 647 | 647 | <br /><br /> |
| 648 | 648 | <table class="lrPadding c-list">' . |
| 649 | - $code . |
|
| 649 | + $code. |
|
| 650 | 650 | '</table>'; |
| 651 | 651 | } |
| 652 | 652 | } |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | protected function outputCsvFile() |
| 666 | 666 | { |
| 667 | 667 | |
| 668 | - if ( ! count($this->CSVaccu)) { |
|
| 668 | + if (!count($this->CSVaccu)) { |
|
| 669 | 669 | $this->addWarningMessage($GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.canNotExportEmptyQueueToCsvText')); |
| 670 | 670 | |
| 671 | 671 | return; |
@@ -685,11 +685,11 @@ discard block |
||
| 685 | 685 | |
| 686 | 686 | // Creating output header: |
| 687 | 687 | $mimeType = 'application/octet-stream'; |
| 688 | - Header('Content-Type: ' . $mimeType); |
|
| 688 | + Header('Content-Type: '.$mimeType); |
|
| 689 | 689 | Header('Content-Disposition: attachment; filename=CrawlerLog.csv'); |
| 690 | 690 | |
| 691 | 691 | // Printing the content of the CSV lines: |
| 692 | - echo implode(chr(13) . chr(10), $csvLines); |
|
| 692 | + echo implode(chr(13).chr(10), $csvLines); |
|
| 693 | 693 | |
| 694 | 694 | // Exits: |
| 695 | 695 | exit; |
@@ -742,8 +742,8 @@ discard block |
||
| 742 | 742 | foreach ($res as $kk => $vv) { |
| 743 | 743 | |
| 744 | 744 | // Title column: |
| 745 | - if ( ! $c) { |
|
| 746 | - $titleClm = '<td rowspan="' . count($res) . '">' . $titleString . '</td>'; |
|
| 745 | + if (!$c) { |
|
| 746 | + $titleClm = '<td rowspan="'.count($res).'">'.$titleString.'</td>'; |
|
| 747 | 747 | } else { |
| 748 | 748 | $titleClm = ''; |
| 749 | 749 | } |
@@ -762,11 +762,11 @@ discard block |
||
| 762 | 762 | if ($this->pObj->MOD_SETTINGS['log_resultLog']) { |
| 763 | 763 | $rowData['result_log'] = $resLog; |
| 764 | 764 | } else { |
| 765 | - $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
| 765 | + $rowData['scheduled'] = ($vv['scheduled'] > 0) ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['scheduled']) : ' '.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.immediate'); |
|
| 766 | 766 | $rowData['exec_time'] = $vv['exec_time'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($vv['exec_time']) : '-'; |
| 767 | 767 | } |
| 768 | 768 | $rowData['result_status'] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($resStatus, 50); |
| 769 | - $rowData['url'] = '<a href="' . htmlspecialchars($parameters['url']) . '" target="_newWIndow">' . htmlspecialchars($parameters['url']) . '</a>'; |
|
| 769 | + $rowData['url'] = '<a href="'.htmlspecialchars($parameters['url']).'" target="_newWIndow">'.htmlspecialchars($parameters['url']).'</a>'; |
|
| 770 | 770 | $rowData['feUserGroupList'] = $parameters['feUserGroupList']; |
| 771 | 771 | $rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ', |
| 772 | 772 | $parameters['procInstructions']) : ''; |
@@ -780,31 +780,31 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | $setId = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('setID')); |
| 782 | 782 | |
| 783 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'gfx/refresh_n.gif'; |
|
| 783 | + $refreshIcon = $GLOBALS['BACK_PATH'].'gfx/refresh_n.gif'; |
|
| 784 | 784 | if (version_compare(TYPO3_version, '7.0', '>=')) { |
| 785 | - $refreshIcon = $GLOBALS['BACK_PATH'] . 'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
| 785 | + $refreshIcon = $GLOBALS['BACK_PATH'].'sysext/t3skin/extjs/images/grid/refresh.gif'; |
|
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | // Put rows together: |
| 789 | 789 | $content .= ' |
| 790 | - <tr class="bgColor' . ($c % 2 ? '-20' : '-10') . '"> |
|
| 791 | - ' . $titleClm . ' |
|
| 790 | + <tr class="bgColor' . ($c % 2 ? '-20' : '-10').'"> |
|
| 791 | + ' . $titleClm.' |
|
| 792 | 792 | <td><a href="' . $this->getModuleUrl([ |
| 793 | 793 | 'qid_details' => $vv['qid'], |
| 794 | 794 | 'setID' => $setId |
| 795 | - ]) . '">' . htmlspecialchars($vv['qid']) . '</a></td> |
|
| 795 | + ]).'">'.htmlspecialchars($vv['qid']).'</a></td> |
|
| 796 | 796 | <td><a href="' . $this->getModuleUrl([ |
| 797 | 797 | 'qid_read' => $vv['qid'], |
| 798 | 798 | 'setID' => $setId |
| 799 | - ]) . '"><img src="' . $refreshIcon . '" width="14" hspace="1" vspace="2" height="14" border="0" title="' . htmlspecialchars('Read') . '" alt="" /></a></td>'; |
|
| 799 | + ]).'"><img src="'.$refreshIcon.'" width="14" hspace="1" vspace="2" height="14" border="0" title="'.htmlspecialchars('Read').'" alt="" /></a></td>'; |
|
| 800 | 800 | foreach ($rowData as $fKey => $value) { |
| 801 | 801 | |
| 802 | 802 | if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('url', $fKey)) { |
| 803 | 803 | $content .= ' |
| 804 | - <td>' . $value . '</td>'; |
|
| 804 | + <td>' . $value.'</td>'; |
|
| 805 | 805 | } else { |
| 806 | 806 | $content .= ' |
| 807 | - <td>' . nl2br(htmlspecialchars($value)) . '</td>'; |
|
| 807 | + <td>' . nl2br(htmlspecialchars($value)).'</td>'; |
|
| 808 | 808 | } |
| 809 | 809 | } |
| 810 | 810 | $content .= ' |
@@ -825,8 +825,8 @@ discard block |
||
| 825 | 825 | // Compile row: |
| 826 | 826 | $content = ' |
| 827 | 827 | <tr class="bgColor-20"> |
| 828 | - <td>' . $titleString . '</td> |
|
| 829 | - <td colspan="' . $colSpan . '"><em>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noentries') . '</em></td> |
|
| 828 | + <td>' . $titleString.'</td> |
|
| 829 | + <td colspan="' . $colSpan.'"><em>'.$GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noentries').'</em></td> |
|
| 830 | 830 | </tr>'; |
| 831 | 831 | } |
| 832 | 832 | |
@@ -863,22 +863,22 @@ discard block |
||
| 863 | 863 | |
| 864 | 864 | $content = ' |
| 865 | 865 | <tr class="bgColor5 tableheader"> |
| 866 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle') . ':</td> |
|
| 867 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid') . ':</td> |
|
| 866 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.pagetitle').':</td> |
|
| 867 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.qid').':</td> |
|
| 868 | 868 | <td> </td>' . |
| 869 | 869 | ($this->pObj->MOD_SETTINGS['log_resultLog'] ? ' |
| 870 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog') . ':</td>' : ' |
|
| 871 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime') . ':</td> |
|
| 872 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime') . ':</td>') . ' |
|
| 873 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.status') . ':</td> |
|
| 874 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.url') . ':</td> |
|
| 875 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups') . ':</td> |
|
| 876 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr') . ':</td> |
|
| 877 | - <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td>' . |
|
| 870 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.resultlog').':</td>' : ' |
|
| 871 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.scheduledtime').':</td> |
|
| 872 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.runtime').':</td>').' |
|
| 873 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.status').':</td> |
|
| 874 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.url').':</td> |
|
| 875 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.groups').':</td> |
|
| 876 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.procinstr').':</td> |
|
| 877 | + <td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid').':</td>'. |
|
| 878 | 878 | ($this->pObj->MOD_SETTINGS['log_feVars'] ? ' |
| 879 | - <td>' . htmlspecialchars('TSFE->id') . '</td> |
|
| 880 | - <td>' . htmlspecialchars('TSFE->gr_list') . '</td> |
|
| 881 | - <td>' . htmlspecialchars('TSFE->no_cache') . '</td>' : '') . ' |
|
| 879 | + <td>' . htmlspecialchars('TSFE->id').'</td> |
|
| 880 | + <td>' . htmlspecialchars('TSFE->gr_list').'</td> |
|
| 881 | + <td>' . htmlspecialchars('TSFE->no_cache').'</td>' : '').' |
|
| 882 | 882 | </tr>'; |
| 883 | 883 | |
| 884 | 884 | return $content; |
@@ -923,8 +923,8 @@ discard block |
||
| 923 | 923 | } |
| 924 | 924 | $resLog = is_array($requestResult['log']) ? implode(chr(10), $requestResult['log']) : ''; |
| 925 | 925 | } else { |
| 926 | - $resStatus = 'Error: ' . substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, |
|
| 927 | - 10000) . '...'; |
|
| 926 | + $resStatus = 'Error: '.substr(preg_replace('/\s+/', ' ', strip_tags($requestContent['content'])), 0, |
|
| 927 | + 10000).'...'; |
|
| 928 | 928 | } |
| 929 | 929 | } else { |
| 930 | 930 | $resStatus = '-'; |
@@ -981,10 +981,10 @@ discard block |
||
| 981 | 981 | |
| 982 | 982 | $listView = new tx_crawler_view_process_list(); |
| 983 | 983 | $listView->setPageId($this->pObj->id); |
| 984 | - $listView->setIconPath($BACK_PATH . '../typo3conf/ext/crawler/template/process/res/img/'); |
|
| 984 | + $listView->setIconPath($BACK_PATH.'../typo3conf/ext/crawler/template/process/res/img/'); |
|
| 985 | 985 | $listView->setProcessCollection($allProcesses); |
| 986 | 986 | $listView->setCliPath($this->processManager->getCrawlerCliPath()); |
| 987 | - $listView->setIsCrawlerEnabled(! $crawler->getDisabled() && ! $this->isErrorDetected); |
|
| 987 | + $listView->setIsCrawlerEnabled(!$crawler->getDisabled() && !$this->isErrorDetected); |
|
| 988 | 988 | $listView->setTotalUnprocessedItemCount($queueRepository->countAllPendingItems()); |
| 989 | 989 | $listView->setAssignedUnprocessedItemCount($queueRepository->countAllAssignedPendingItems()); |
| 990 | 990 | $listView->setActiveProcessCount($processRepository->countActive()); |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | $output = $listView->render(); |
| 1001 | 1001 | |
| 1002 | 1002 | if ($paginationView->getTotalPagesCount() > 1) { |
| 1003 | - $output .= ' <br />' . $paginationView->render(); |
|
| 1003 | + $output .= ' <br />'.$paginationView->render(); |
|
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | return $output; |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | |
| 1031 | 1031 | $exitCode = 0; |
| 1032 | 1032 | $out = []; |
| 1033 | - exec(escapeshellcmd($this->extensionSettings['phpPath'] . ' -v'), $out, $exitCode); |
|
| 1033 | + exec(escapeshellcmd($this->extensionSettings['phpPath'].' -v'), $out, $exitCode); |
|
| 1034 | 1034 | if ($exitCode > 0) { |
| 1035 | 1035 | $this->addErrorMessage(sprintf($LANG->sL('LLL:EXT:crawler/modfunc1/locallang.xml:message.phpBinaryNotFound'), |
| 1036 | 1036 | htmlspecialchars($this->extensionSettings['phpPath']))); |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | */ |
| 1138 | 1138 | protected function findCrawler() |
| 1139 | 1139 | { |
| 1140 | - if ( ! $this->crawlerObj instanceof tx_crawler_lib) { |
|
| 1140 | + if (!$this->crawlerObj instanceof tx_crawler_lib) { |
|
| 1141 | 1141 | $this->crawlerObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_crawler_lib'); |
| 1142 | 1142 | } |
| 1143 | 1143 | |
@@ -1250,13 +1250,13 @@ discard block |
||
| 1250 | 1250 | $options = []; |
| 1251 | 1251 | foreach ($optArray as $key => $val) { |
| 1252 | 1252 | $options[] = ' |
| 1253 | - <option value="' . htmlspecialchars($key) . '"' . (( ! $multiple && ! strcmp($value, |
|
| 1253 | + <option value="' . htmlspecialchars($key).'"'.((!$multiple && !strcmp($value, |
|
| 1254 | 1254 | $key)) || ($multiple && in_array($key, |
| 1255 | - (array)$value)) ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>'; |
|
| 1255 | + (array) $value)) ? ' selected="selected"' : '').'>'.htmlspecialchars($val).'</option>'; |
|
| 1256 | 1256 | } |
| 1257 | 1257 | |
| 1258 | - $output = '<select name="' . htmlspecialchars($name . ($multiple ? '[]' : '')) . '"' . ($multiple ? ' multiple="multiple" size="' . count($options) . '"' : '') . '>' . implode('', |
|
| 1259 | - $options) . '</select>'; |
|
| 1258 | + $output = '<select name="'.htmlspecialchars($name.($multiple ? '[]' : '')).'"'.($multiple ? ' multiple="multiple" size="'.count($options).'"' : '').'>'.implode('', |
|
| 1259 | + $options).'</select>'; |
|
| 1260 | 1260 | |
| 1261 | 1261 | return $output; |
| 1262 | 1262 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | // input for startPage |
| 92 | 92 | $fieldId = 'task_startPage'; |
| 93 | - $fieldCode = '<input name="tx_scheduler[startPage]" type="text" id="' . $fieldId . '" value="' . $task->startPage . '" />'; |
|
| 93 | + $fieldCode = '<input name="tx_scheduler[startPage]" type="text" id="'.$fieldId.'" value="'.$task->startPage.'" />'; |
|
| 94 | 94 | $additionalFields[$fieldId] = array( |
| 95 | 95 | 'code' => $fieldCode, |
| 96 | 96 | 'label' => 'LLL:EXT:crawler/Resources/Private/Language/Backend.xlf:crawler_im.startPage' |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | '4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_4'), |
| 107 | 107 | '99' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'), |
| 108 | 108 | ); |
| 109 | - $fieldCode = '<select name="tx_scheduler[depth]" id="' . $fieldId . '">'; |
|
| 109 | + $fieldCode = '<select name="tx_scheduler[depth]" id="'.$fieldId.'">'; |
|
| 110 | 110 | |
| 111 | 111 | foreach ($fieldValueArray as $key => $label) { |
| 112 | - $fieldCode .= "\t" . '<option value="' . $key . '"' . (($key == $task->depth) ? ' selected="selected"' : '') . '>' . $label . '</option>'; |
|
| 112 | + $fieldCode .= "\t".'<option value="'.$key.'"'.(($key == $task->depth) ? ' selected="selected"' : '').'>'.$label.'</option>'; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | $fieldCode .= '</select>'; |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | // combobox for configuration records |
| 122 | 122 | $recordsArray = $this->getCrawlerConfigurationRecords(); |
| 123 | 123 | $fieldId = 'task_configuration'; |
| 124 | - $fieldCode = '<select name="tx_scheduler[configuration][]" multiple="multiple" id="' . $fieldId . '">'; |
|
| 125 | - $fieldCode .= "\t" . '<option value=""></option>'; |
|
| 124 | + $fieldCode = '<select name="tx_scheduler[configuration][]" multiple="multiple" id="'.$fieldId.'">'; |
|
| 125 | + $fieldCode .= "\t".'<option value=""></option>'; |
|
| 126 | 126 | $arraySize = count($recordsArray); |
| 127 | 127 | for ($i = 0; $i < $arraySize; $i++) { |
| 128 | - $fieldCode .= "\t" . '<option ' . $this->getSelectedState($task->configuration, $recordsArray[$i]['name']) . 'value="' . $recordsArray[$i]['name'] . '">' . $recordsArray[$i]['name'] . '</option>'; |
|
| 128 | + $fieldCode .= "\t".'<option '.$this->getSelectedState($task->configuration, $recordsArray[$i]['name']).'value="'.$recordsArray[$i]['name'].'">'.$recordsArray[$i]['name'].'</option>'; |
|
| 129 | 129 | } |
| 130 | 130 | $fieldCode .= '</select>'; |
| 131 | 131 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
| 169 | 169 | '*', |
| 170 | 170 | 'tx_crawler_configuration', |
| 171 | - '1=1' . BackendUtility::deleteClause('tx_crawler_configuration') |
|
| 171 | + '1=1'.BackendUtility::deleteClause('tx_crawler_configuration') |
|
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | 174 | while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | */ |
| 361 | 361 | protected function getRefreshLink() |
| 362 | 362 | { |
| 363 | - return '<input onclick="window.location=\'' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info') . '&SET[crawlaction]=multiprocess' . '\';" 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') . '" />'; |
|
| 363 | + return '<input onclick="window.location=\''.\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_info').'&SET[crawlaction]=multiprocess'.'\';" 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').'" />'; |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | /** |
@@ -381,9 +381,9 @@ discard block |
||
| 381 | 381 | protected function getEnableDisableLink() |
| 382 | 382 | { |
| 383 | 383 | if ($this->getIsCrawlerEnabled()) { |
| 384 | - 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') . '" />'; |
|
| 384 | + 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').'" />'; |
|
| 385 | 385 | } else { |
| 386 | - 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') . '" />'; |
|
| 386 | + 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').'" />'; |
|
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | |
@@ -397,9 +397,9 @@ discard block |
||
| 397 | 397 | protected function getModeLink() |
| 398 | 398 | { |
| 399 | 399 | if ($this->getMode() == 'detail') { |
| 400 | - 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') . '" />'; |
|
| 400 | + 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').'" />'; |
|
| 401 | 401 | } elseif ($this->getMode() == 'simple') { |
| 402 | - 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') . '" />'; |
|
| 402 | + 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').'" />'; |
|
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | protected function getAddLink() |
| 414 | 414 | { |
| 415 | 415 | if ($this->getActiveProcessCount() < $this->getMaxActiveProcessCount() && $this->getIsCrawlerEnabled()) { |
| 416 | - 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') . '" />'; |
|
| 416 | + 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').'" />'; |
|
| 417 | 417 | } else { |
| 418 | 418 | return ''; |
| 419 | 419 | } |
@@ -438,11 +438,11 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | protected function getIcon($icon, $title = '') |
| 440 | 440 | { |
| 441 | - if ( ! empty($title)) { |
|
| 442 | - $title = ' title="' . $title . '"'; |
|
| 441 | + if (!empty($title)) { |
|
| 442 | + $title = ' title="'.$title.'"'; |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | - return '<img src="' . $this->getIconPath() . $icon . '.png" ' . $title . ' />'; |
|
| 445 | + return '<img src="'.$this->getIconPath().$icon.'.png" '.$title.' />'; |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /** |