Completed
Push — issue/139 ( 801131...971053 )
by Tomas Norre
06:40
created
Classes/Hooks/StaticFileCacheCreateUriHook.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      * @param string $uri
54 54
      * @param TypoScriptFrontendController $frontend
55 55
      *
56
-     * @return array
56
+     * @return string[]
57 57
      *
58 58
      * @throws \Exception
59 59
      *
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@
 block discarded – undo
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 === '/') {
Please login to merge, or discard this patch.
Classes/Api/CrawlerApi.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@
 block discarded – undo
209 209
     /**
210 210
      * Determines if a page is queued
211 211
      *
212
-     * @param $uid
212
+     * @param integer $uid
213 213
      * @param bool $unprocessed_only
214 214
      * @param bool $timed_only
215 215
      * @param bool $timestamp
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     protected function findCrawler()
93 93
     {
94
-        if (! is_object($this->crawlerObj)) {
94
+        if (!is_object($this->crawlerObj)) {
95 95
             $this->crawlerObj = GeneralUtility::makeInstance('tx_crawler_lib');
96 96
             $this->crawlerObj->setID = GeneralUtility::md5int(microtime());
97 97
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if (count($this->allowedConfigrations) > 0) {
127 127
             // 	remove configuration that does not match the current selection
128 128
             foreach ($configurations as $confKey => $confArray) {
129
-                if (! in_array($confKey, $this->allowedConfigrations)) {
129
+                if (!in_array($confKey, $this->allowedConfigrations)) {
130 130
                     unset($configurations[$confKey]);
131 131
                 }
132 132
             }
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
         //if the same page is scheduled for the same time and has not be executed?
192 192
         if ($schedule_timestamp == 0) {
193 193
             //untimed elements need an exec_time with 0 because they can occure multiple times
194
-            $where = 'page_id=' . $page_uid . ' AND exec_time = 0 AND scheduled=' . $schedule_timestamp;
194
+            $where = 'page_id='.$page_uid.' AND exec_time = 0 AND scheduled='.$schedule_timestamp;
195 195
         } else {
196 196
             //timed elementes have got a fixed schedule time, if a record with this time
197 197
             //exists it is maybe queued for the future, or is has been queue for the past and therefore
198 198
             //also been processed.
199
-            $where = 'page_id=' . $page_uid . ' AND scheduled=' . $schedule_timestamp;
199
+            $where = 'page_id='.$page_uid.' AND scheduled='.$schedule_timestamp;
200 200
         }
201 201
 
202 202
         $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($GLOBALS['TYPO3_DB']->exec_SELECTquery(
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
         $isPageInQueue = false;
228 228
 
229
-        $whereClause = 'page_id = ' . (integer)$uid;
229
+        $whereClause = 'page_id = '.(integer) $uid;
230 230
 
231 231
         if (false !== $unprocessed_only) {
232 232
             $whereClause .= ' AND exec_time = 0';
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         }
238 238
 
239 239
         if (false !== $timestamp) {
240
-            $whereClause .= ' AND scheduled = ' . (integer)$timestamp;
240
+            $whereClause .= ' AND scheduled = '.(integer) $timestamp;
241 241
         }
242 242
 
243 243
         $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
     {
267 267
         $uid = intval($uid);
268 268
         $query = 'max(scheduled) as latest';
269
-        $where = ' page_id = ' . $uid;
269
+        $where = ' page_id = '.$uid;
270 270
 
271 271
         if ($future_crawldates_only) {
272
-            $where .= ' AND scheduled > ' . time();
272
+            $where .= ' AND scheduled > '.time();
273 273
         }
274 274
 
275 275
         if ($unprocessed_only) {
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         $limit = $GLOBALS['TYPO3_DB']->fullQuoteStr($limit, 'tx_crawler_queue');
303 303
 
304 304
         $query = 'scheduled, exec_time, set_id';
305
-        $where = ' page_id = ' . $uid;
305
+        $where = ' page_id = '.$uid;
306 306
 
307 307
         $limit_query = ($limit) ? $limit : null;
308 308
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
     {
380 380
         $qid = intval($qid);
381 381
         $table = 'tx_crawler_queue';
382
-        $where = ' qid=' . $qid;
382
+        $where = ' qid='.$qid;
383 383
         $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, $where);
384 384
     }
385 385
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
      */
408 408
     protected function getQueueRepository()
409 409
     {
410
-        if (! $this->queueRepository instanceof \tx_crawler_domain_queue_repository) {
410
+        if (!$this->queueRepository instanceof \tx_crawler_domain_queue_repository) {
411 411
             $this->queueRepository = new \tx_crawler_domain_queue_repository();
412 412
         }
413 413
 
Please login to merge, or discard this patch.
domain/process/class.tx_crawler_domain_process_repository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Classes/Task/CrawlMultiProcessTask.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
template/process/list.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,11 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
cli/class.tx_crawler_cli_im.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@
 block discarded – undo
49 49
 
50 50
         // Adding options to help archive:
51 51
         /**
52
-        * We removed the "proc" option as it seemd not to be working any more. But as the complete handling of the crawler has changed regarding the configuration
53
-        * this is completely ok. Since configuration records were introduced to configure "what should be done" additionally to page ts the way to setup jobs
54
-        * has drifted from selecting filtering processing instructions to selecting/filtering configuration keys (you can configure the processing instructions there).
55
-        * This is also reflected in the backend modules and allows you a much clearer and powerful way to work with the crawler extension.
56
-        */
52
+         * We removed the "proc" option as it seemd not to be working any more. But as the complete handling of the crawler has changed regarding the configuration
53
+         * this is completely ok. Since configuration records were introduced to configure "what should be done" additionally to page ts the way to setup jobs
54
+         * has drifted from selecting filtering processing instructions to selecting/filtering configuration keys (you can configure the processing instructions there).
55
+         * This is also reflected in the backend modules and allows you a much clearer and powerful way to work with the crawler extension.
56
+         */
57 57
         // $this->cli_options[] = array('-proc listOfProcInstr', 'Comma list of processing instructions. These are the "actions" carried out when crawling and you must specify at least one. Depends on third-party extensions. Examples are "tx_cachemgm_recache" from "cachemgm" extension (will recache pages), "tx_staticpub_publish" from "staticpub" (publishing pages to static files) or "tx_indexedsearch_reindex" from "indexed_search" (indexes pages).');
58 58
         // TODO: cleanup here!
59 59
         $this->cli_options[] = ['-d depth', 'Tree depth, 0-99', "How many levels under the 'page_id' to include."];
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
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:
Please login to merge, or discard this patch.
cli/crawler_multiprocess.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,5 +9,5 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
domain/events/class.tx_crawler_domain_events_dispatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Classes/Utility/HookUtility.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,17 +45,17 @@
 block discarded – undo
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'][] =
Please login to merge, or discard this patch.