Passed
Push — master ( 34e8da...f497d2 )
by
unknown
06:10 queued 02:50
created
mapi/class.taskrequest.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
 	 * carried in the IPM.TaskRequest item (although this information seems
24 24
 	 * redundant due to that information already being available in PR_MESSAGE_CLASS).
25 25
 	 */
26
-	define('tdmtNothing', 0);            // Value in IPM.Task items
27
-	define('tdmtTaskReq', 1);            // Assigner -> Assignee
28
-	define('tdmtTaskAcc', 2);            // Assignee -> Assigner
29
-	define('tdmtTaskDec', 3);            // Assignee -> Assigner
30
-	define('tdmtTaskUpd', 4);            // Assignee -> Assigner
31
-	define('tdmtTaskSELF', 5);            // Assigner -> Assigner (?)
26
+	define('tdmtNothing', 0); // Value in IPM.Task items
27
+	define('tdmtTaskReq', 1); // Assigner -> Assignee
28
+	define('tdmtTaskAcc', 2); // Assignee -> Assigner
29
+	define('tdmtTaskDec', 3); // Assignee -> Assigner
30
+	define('tdmtTaskUpd', 4); // Assignee -> Assigner
31
+	define('tdmtTaskSELF', 5); // Assigner -> Assigner (?)
32 32
 
33 33
 	/* The TaskHistory is used to show the last action on the task
34 34
 	 * on both the assigner and the assignee's side.
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
 	 * the format 'Accepted by <user> on 01-01-2010 11:00'.
39 39
 	 */
40 40
 	define('thNone', 0);
41
-	define('thAccepted', 1);            // Set by assignee
42
-	define('thDeclined', 2);            // Set by assignee
43
-	define('thUpdated', 3);                // Set by assignee
41
+	define('thAccepted', 1); // Set by assignee
42
+	define('thDeclined', 2); // Set by assignee
43
+	define('thUpdated', 3); // Set by assignee
44 44
 	define('thDueDateChanged', 4);
45
-	define('thAssigned', 5);            // Set by assigner
45
+	define('thAssigned', 5); // Set by assigner
46 46
 
47 47
 	/* The TaskState value is used to differentiate the version of a task
48 48
 	 * in the assigner's folder and the version in the
49 49
 	 * assignee's folder. The buttons shown depend on this and
50 50
 	 * the 'taskaccepted' boolean (for the assignee)
51 51
 	 */
52
-	define('tdsNOM', 0);        // Got a response to a deleted task, and re-created the task for the assigner
53
-	define('tdsOWNNEW', 1);        // Not assigned
54
-	define('tdsOWN', 2);        // Assignee version
55
-	define('tdsACC', 3);        // Assigner version
56
-	define('tdsDEC', 4);        // Assigner version, but assignee declined
52
+	define('tdsNOM', 0); // Got a response to a deleted task, and re-created the task for the assigner
53
+	define('tdsOWNNEW', 1); // Not assigned
54
+	define('tdsOWN', 2); // Assignee version
55
+	define('tdsACC', 3); // Assigner version
56
+	define('tdsDEC', 4); // Assigner version, but assignee declined
57 57
 
58 58
 	/* The TaskAcceptanceState is used for the assigner to indicate state */
59 59
 	define('olTaskNotDelegated', 0);
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 
64 64
 	/* The task ownership indicates the role of the current user relative to the task. */
65 65
 	define('olNewTask', 0);
66
-	define('olDelegatedTask', 1);    // Task has been assigned
67
-	define('olOwnTask', 2);            // Task owned
66
+	define('olDelegatedTask', 1); // Task has been assigned
67
+	define('olOwnTask', 2); // Task owned
68 68
 
69 69
 	/* taskmultrecips indicates whether the task request sent or received has multiple assignees or not. */
70 70
 	define('tmrNone', 0);
71
-	define('tmrSent', 1);        // Task has been sent to multiple assignee
72
-	define('tmrReceived', 2);    // Task Request received has multiple assignee
71
+	define('tmrSent', 1); // Task has been sent to multiple assignee
72
+	define('tmrReceived', 2); // Task Request received has multiple assignee
73 73
 
74 74
 	// Task icon index.
75 75
 	define('ICON_TASK_ASSIGNEE', 0x00000502);
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 					VALUE => $goid, ],
308 308
 				];
309 309
 
310
-				$table = mapi_folder_getcontentstable($folder, MAPI_DEFERRED_ERRORS | SHOW_SOFT_DELETES);
310
+				$table = mapi_folder_getcontentstable($folder, MAPI_DEFERRED_ERRORS|SHOW_SOFT_DELETES);
311 311
 				$softDeletedItems = mapi_table_queryallrows($table, [PR_ENTRYID], $restriction);
312 312
 				if (!empty($softDeletedItems)) {
313 313
 					return true;
@@ -515,14 +515,14 @@  discard block
 block discarded – undo
515 515
 			// Set properties on Task Request
516 516
 			mapi_setprops($this->message, [
517 517
 				$this->props['task_goid'] => $taskid, /* our new task_goid */
518
-				$this->props['taskstate'] => tdsACC,         /* state for our outgoing request */
519
-				$this->props['taskmode'] => tdmtNothing,     /* we're not sending a change */
520
-				$this->props['updatecount'] => 2,            /* version 2 (no idea) */
518
+				$this->props['taskstate'] => tdsACC, /* state for our outgoing request */
519
+				$this->props['taskmode'] => tdmtNothing, /* we're not sending a change */
520
+				$this->props['updatecount'] => 2, /* version 2 (no idea) */
521 521
 				$this->props['task_acceptance_state'] => olTaskDelegationUnknown, /* no reply yet */
522 522
 				$this->props['ownership'] => olDelegatedTask, /* Task has been assigned */
523
-				$this->props['taskhistory'] => thAssigned,    /* Task has been assigned */
523
+				$this->props['taskhistory'] => thAssigned, /* Task has been assigned */
524 524
 				PR_CONVERSATION_TOPIC => $messageprops[PR_SUBJECT],
525
-				PR_ICON_INDEX => ICON_TASK_ASSIGNER,         /* Task request icon */
525
+				PR_ICON_INDEX => ICON_TASK_ASSIGNER, /* Task request icon */
526 526
 			]);
527 527
 			$this->setLastUser();
528 528
 			$this->setOwnerForAssignor();
@@ -537,12 +537,12 @@  discard block
 block discarded – undo
537 537
 
538 538
 			// Make it a task request, and put it in sent items after it is sent
539 539
 			mapi_setprops($outgoing, [
540
-				PR_MESSAGE_CLASS => "IPM.TaskRequest",         /* class is task request */
541
-				$this->props['taskstate'] => tdsOWN,         /* for the recipient he is the task owner */
542
-				$this->props['taskmode'] => tdmtTaskReq,    /* for the recipient it's a request */
543
-				$this->props['updatecount'] => 1,            /* version 2 is in the attachment */
540
+				PR_MESSAGE_CLASS => "IPM.TaskRequest", /* class is task request */
541
+				$this->props['taskstate'] => tdsOWN, /* for the recipient he is the task owner */
542
+				$this->props['taskmode'] => tdmtTaskReq, /* for the recipient it's a request */
543
+				$this->props['updatecount'] => 1, /* version 2 is in the attachment */
544 544
 				PR_SUBJECT_PREFIX => $prefix,
545
-				PR_SUBJECT => $prefix . $messageprops[PR_SUBJECT],
545
+				PR_SUBJECT => $prefix.$messageprops[PR_SUBJECT],
546 546
 			]);
547 547
 
548 548
 			$attach = mapi_message_createattach($outgoing);
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 				PR_ATTACHMENT_HIDDEN => true,
552 552
 				PR_DISPLAY_NAME => $messageprops[PR_SUBJECT], ]);
553 553
 
554
-			$sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_MODIFY | MAPI_CREATE);
554
+			$sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_MODIFY|MAPI_CREATE);
555 555
 
556 556
 			mapi_copyto($this->message, [], [], $sub);
557 557
 			mapi_savechanges($sub);
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		 * @return entryid EntryID of the accepted task
650 650
 		 */
651 651
 		public function doAccept() {
652
-			$prefix = _("Task Accepted:") . " ";
652
+			$prefix = _("Task Accepted:")." ";
653 653
 			$messageProps = mapi_getprops($this->message, [PR_MESSAGE_CLASS, $this->props['taskstate']]);
654 654
 
655 655
 			if (!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 		 * @return boolean TRUE on success, FALSE on failure
699 699
 		 */
700 700
 		public function doDecline() {
701
-			$prefix = _("Task Declined:") . " ";
701
+			$prefix = _("Task Declined:")." ";
702 702
 			$messageProps = mapi_getprops($this->message, [$this->props['taskstate']]);
703 703
 
704 704
 			if (!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
@@ -753,10 +753,10 @@  discard block
 block discarded – undo
753 753
 
754 754
 			$props = mapi_getprops($this->message, [$this->props['taskupdates'], $this->props['tasksoc'], $this->props['recurring'], $this->props['complete']]);
755 755
 			if (!$props[$this->props['complete']] && $props[$this->props['taskupdates']] && !(isset($props[$this->props['recurring']]) && $props[$this->props['recurring']])) {
756
-				$this->sendResponse(tdmtTaskUpd, _("Task Updated:") . " ");
756
+				$this->sendResponse(tdmtTaskUpd, _("Task Updated:")." ");
757 757
 			}
758 758
 			elseif ($props[$this->props['complete']]) {
759
-				$this->sendResponse(tdmtTaskUpd, _("Task Completed:") . " ");
759
+				$this->sendResponse(tdmtTaskUpd, _("Task Completed:")." ");
760 760
 			}
761 761
 
762 762
 			return true;
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 
891 891
 			$attach = mapi_message_createattach($outgoing);
892 892
 			mapi_setprops($attach, [PR_ATTACH_METHOD => ATTACH_EMBEDDED_MSG, PR_DISPLAY_NAME => $messageprops[PR_CONVERSATION_TOPIC], PR_ATTACHMENT_HIDDEN => true]);
893
-			$sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_CREATE | MAPI_MODIFY);
893
+			$sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_CREATE|MAPI_MODIFY);
894 894
 
895 895
 			$message = !$this->isTaskRequest() ? $this->message : $this->getAssociatedTask(false);
896 896
 
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 			mapi_savechanges($sub);
934 934
 			mapi_savechanges($attach);
935 935
 
936
-			$props[PR_SUBJECT] = $prefix . $messageprops[PR_CONVERSATION_TOPIC];
936
+			$props[PR_SUBJECT] = $prefix.$messageprops[PR_CONVERSATION_TOPIC];
937 937
 			$props[$this->props['taskmode']] = $type;
938 938
 			$props[$this->props['task_assigned_time']] = time();
939 939
 
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 			// edit response before sending task response.
944 944
 			if ($this->taskCommentsInfo) {
945 945
 				$comments = $this->getTaskCommentsInfo();
946
-				$stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, STGM_TRANSACTED, MAPI_CREATE | MAPI_MODIFY);
946
+				$stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, STGM_TRANSACTED, MAPI_CREATE|MAPI_MODIFY);
947 947
 				mapi_stream_setsize($stream, strlen($comments));
948 948
 				mapi_stream_write($stream, $comments);
949 949
 				mapi_stream_commit($stream);
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 				}
1207 1207
 
1208 1208
 				foreach ($recips as $recip) {
1209
-					$recip[PR_RECIPIENT_TYPE] = MAPI_TO;    // Change recipient type to MAPI_TO
1209
+					$recip[PR_RECIPIENT_TYPE] = MAPI_TO; // Change recipient type to MAPI_TO
1210 1210
 					mapi_message_modifyrecipients($outgoing, MODRECIP_ADD, [$recip]);
1211 1211
 				}
1212 1212
 
Please login to merge, or discard this patch.
grommunio-sync-top.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  * MAIN
21 21
  */
22 22
 	declare(ticks=1);
23
-	define('BASE_PATH_CLI', dirname(__FILE__) . "/");
24
-	set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
23
+	define('BASE_PATH_CLI', dirname(__FILE__)."/");
24
+	set_include_path(get_include_path().PATH_SEPARATOR.BASE_PATH_CLI);
25 25
 
26 26
 	if (!defined('GSYNC_CONFIG')) {
27
-		define('GSYNC_CONFIG', BASE_PATH_CLI . 'config.php');
27
+		define('GSYNC_CONFIG', BASE_PATH_CLI.'config.php');
28 28
 	}
29 29
 
30 30
 	include_once GSYNC_CONFIG;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		}
60 60
 	}
61 61
 	catch (GSyncException $zpe) {
62
-		fwrite(STDERR, get_class($zpe) . ": " . $zpe->getMessage() . "\n");
62
+		fwrite(STDERR, get_class($zpe).": ".$zpe->getMessage()."\n");
63 63
 
64 64
 		exit(1);
65 65
 	}
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
 
260 260
 						$lastUpdate = $this->currenttime - $line["update"];
261 261
 						if ($this->currenttime - $line["update"] < 2) {
262
-							$this->linesActive[$line["update"] . $line["pid"]] = $line;
262
+							$this->linesActive[$line["update"].$line["pid"]] = $line;
263 263
 						}
264 264
 						elseif (($line['push'] === true && $lastUpdate > ($this->pingInterval + 2)) || ($line['push'] !== true && $lastUpdate > 4)) {
265
-							$this->linesUnknown[$line["update"] . $line["pid"]] = $line;
265
+							$this->linesUnknown[$line["update"].$line["pid"]] = $line;
266 266
 						}
267 267
 						else {
268
-							$this->linesOpen[$line["update"] . $line["pid"]] = $line;
268
+							$this->linesOpen[$line["update"].$line["pid"]] = $line;
269 269
 						}
270 270
 					}
271 271
 					else {
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 						}
292 292
 
293 293
 						$line['time'] = $line['ended'] - $line['start'];
294
-						$this->linesTerm[$line['update'] . $line['pid']] = $line;
294
+						$this->linesTerm[$line['update'].$line['pid']] = $line;
295 295
 					}
296 296
 				}
297 297
 			}
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 	private function scrOverview() {
313 313
 		$linesAvail = $this->scrSize['height'] - 8;
314 314
 		$lc = 1;
315
-		$this->scrPrintAt($lc, 0, "\033[1mgrommunio-sync-top live statistics\033[0m\t\t\t\t\t" . @strftime("%d/%m/%Y %T") . "\n");
315
+		$this->scrPrintAt($lc, 0, "\033[1mgrommunio-sync-top live statistics\033[0m\t\t\t\t\t".@strftime("%d/%m/%Y %T")."\n");
316 316
 		++$lc;
317 317
 
318 318
 		$this->scrPrintAt($lc, 0, sprintf("Open connections: %d\t\t\t\tUsers:\t %d\tgrommunio-sync:   %s ", count($this->activeConn), count($this->activeUsers), $this->getVersion()));
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		++$lc;
324 324
 		++$lc;
325 325
 
326
-		$this->scrPrintAt($lc, 0, "\033[4m" . $this->getLine(['pid' => 'PID', 'ip' => 'IP', 'user' => 'USER', 'command' => 'COMMAND', 'time' => 'TIME', 'devagent' => 'AGENT', 'devid' => 'DEVID', 'addinfo' => 'Additional Information']) . str_repeat(" ", 20) . "\033[0m");
326
+		$this->scrPrintAt($lc, 0, "\033[4m".$this->getLine(['pid' => 'PID', 'ip' => 'IP', 'user' => 'USER', 'command' => 'COMMAND', 'time' => 'TIME', 'devagent' => 'AGENT', 'devid' => 'DEVID', 'addinfo' => 'Additional Information']).str_repeat(" ", 20)."\033[0m");
327 327
 		++$lc;
328 328
 
329 329
 		// print help text if requested
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 				break;
372 372
 			}
373 373
 
374
-			$this->scrPrintAt($lc, 0, "\033[01m" . $this->getLine($l) . "\033[0m");
374
+			$this->scrPrintAt($lc, 0, "\033[01m".$this->getLine($l)."\033[0m");
375 375
 			++$lc;
376 376
 			++$linesprinted;
377 377
 		}
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 			if ($l['push'] == false && $time - $l["start"] > 30) {
398 398
 				$color = "1;31m";
399 399
 			}
400
-			$this->scrPrintAt($lc, 0, "\033[0" . $color . $this->getLine($l) . "\033[0m");
400
+			$this->scrPrintAt($lc, 0, "\033[0".$color.$this->getLine($l)."\033[0m");
401 401
 			++$lc;
402 402
 			++$linesprinted;
403 403
 		}
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 				break;
413 413
 			}
414 414
 
415
-			$this->scrPrintAt($lc, 0, "\033[01;30m" . $this->getLine($l) . "\033[0m");
415
+			$this->scrPrintAt($lc, 0, "\033[01;30m".$this->getLine($l)."\033[0m");
416 416
 			++$lc;
417 417
 			++$linesprinted;
418 418
 		}
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 
431 431
 		// show request information and help command
432 432
 		if ($this->starttime + 6 > $this->currenttime) {
433
-			$this->status = sprintf("Requesting information (takes up to %dsecs)", $this->pingInterval) . str_repeat(".", ($this->currenttime - $this->starttime)) . "  type \033[01;31mh\033[00;31m or \033[01;31mhelp\033[00;31m for usage instructions";
433
+			$this->status = sprintf("Requesting information (takes up to %dsecs)", $this->pingInterval).str_repeat(".", ($this->currenttime - $this->starttime))."  type \033[01;31mh\033[00;31m or \033[01;31mhelp\033[00;31m for usage instructions";
434 434
 			$this->statusexpire = $this->currenttime + 1;
435 435
 		}
436 436
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 		}
449 449
 
450 450
 		if ($this->showTermSec != self::SHOW_TERM_DEFAULT_TIME) {
451
-			$str .= "\033[01;32mTerminated: " . $this->showTermSec . "s\033[0m   ";
451
+			$str .= "\033[01;32mTerminated: ".$this->showTermSec."s\033[0m   ";
452 452
 		}
453 453
 
454 454
 		if ($this->filter !== false || ($this->status !== false && $this->statusexpire > $this->currenttime)) {
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 		}
464 464
 		$this->scrPrintAt(5, 0, $str);
465 465
 
466
-		$this->scrPrintAt(4, 0, "Action: \033[01m" . $this->action . "\033[0m");
466
+		$this->scrPrintAt(4, 0, "Action: \033[01m".$this->action."\033[0m");
467 467
 	}
468 468
 
469 469
 	/**
@@ -553,10 +553,10 @@  discard block
 block discarded – undo
553 553
 				// grep the log file
554 554
 				elseif (($cmds[0] == "log" || $cmds[0] == "l") && isset($cmds[1])) {
555 555
 					if (!file_exists(LOGFILE)) {
556
-						$this->status = "Logfile can not be found: " . LOGFILE;
556
+						$this->status = "Logfile can not be found: ".LOGFILE;
557 557
 					}
558 558
 					else {
559
-						system('bash -c "fgrep -a ' . escapeshellarg($cmds[1]) . ' ' . LOGFILE . ' | less +G" > `tty`');
559
+						system('bash -c "fgrep -a '.escapeshellarg($cmds[1]).' '.LOGFILE.' | less +G" > `tty`');
560 560
 						$this->status = "Returning from log, updating data";
561 561
 					}
562 562
 					$this->statusexpire = time() + 5; // it might be much "later" now
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 				// tail the log file
565 565
 				elseif (($cmds[0] == "tail" || $cmds[0] == "t")) {
566 566
 					if (!file_exists(LOGFILE)) {
567
-						$this->status = "Logfile can not be found: " . LOGFILE;
567
+						$this->status = "Logfile can not be found: ".LOGFILE;
568 568
 					}
569 569
 					else {
570 570
 						$this->doingTail = true;
@@ -572,9 +572,9 @@  discard block
 block discarded – undo
572 572
 						$this->scrPrintAt(1, 0, $this->scrAsBold("Press CTRL+C to return to grommunio-sync-top\n\n"));
573 573
 						$secondary = "";
574 574
 						if (isset($cmds[1])) {
575
-							$secondary = " -n 200 | grep " . escapeshellarg($cmds[1]);
575
+							$secondary = " -n 200 | grep ".escapeshellarg($cmds[1]);
576 576
 						}
577
-						system('bash -c "tail -f ' . LOGFILE . $secondary . '" > `tty`');
577
+						system('bash -c "tail -f '.LOGFILE.$secondary.'" > `tty`');
578 578
 						$this->doingTail = false;
579 579
 						$this->status = "Returning from tail, updating data";
580 580
 					}
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 				// tail the error log file
584 584
 				elseif (($cmds[0] == "error" || $cmds[0] == "e")) {
585 585
 					if (!file_exists(LOGERRORFILE)) {
586
-						$this->status = "Error logfile can not be found: " . LOGERRORFILE;
586
+						$this->status = "Error logfile can not be found: ".LOGERRORFILE;
587 587
 					}
588 588
 					else {
589 589
 						$this->doingTail = true;
@@ -591,9 +591,9 @@  discard block
 block discarded – undo
591 591
 						$this->scrPrintAt(1, 0, $this->scrAsBold("Press CTRL+C to return to grommunio-sync-top\n\n"));
592 592
 						$secondary = "";
593 593
 						if (isset($cmds[1])) {
594
-							$secondary = " -n 200 | grep " . escapeshellarg($cmds[1]);
594
+							$secondary = " -n 200 | grep ".escapeshellarg($cmds[1]);
595 595
 						}
596
-						system('bash -c "tail -f ' . LOGERRORFILE . $secondary . '" > `tty`');
596
+						system('bash -c "tail -f '.LOGERRORFILE.$secondary.'" > `tty`');
597 597
 						$this->doingTail = false;
598 598
 						$this->status = "Returning from tail, updating data";
599 599
 					}
@@ -630,9 +630,9 @@  discard block
 block discarded – undo
630 630
 	 * @return string
631 631
 	 */
632 632
 	public function UsageInstructions() {
633
-		$help = "Usage:\n\tgrommunio-sync-top.php\n\n" .
634
-				"  grommunio-sync-top is a live top-like overview of what grommunio-sync is doing. It does not have specific command line options.\n\n" .
635
-				"  When grommunio-sync-top is running you can specify certain actions and options which can be executed (listed below).\n" .
633
+		$help = "Usage:\n\tgrommunio-sync-top.php\n\n".
634
+				"  grommunio-sync-top is a live top-like overview of what grommunio-sync is doing. It does not have specific command line options.\n\n".
635
+				"  When grommunio-sync-top is running you can specify certain actions and options which can be executed (listed below).\n".
636 636
 				"  This help information can also be shown inside grommunio-sync-top by hitting 'help' or 'h'.\n\n";
637 637
 		$scrhelp = $this->scrHelp();
638 638
 		unset($scrhelp[0]);
@@ -651,23 +651,23 @@  discard block
 block discarded – undo
651 651
 	private function scrHelp() {
652 652
 		$h = [];
653 653
 		$secs = $this->helpexpire - $this->currenttime;
654
-		$h[] = "Actions supported by grommunio-sync-top (help page still displayed for " . $secs . "secs)";
655
-		$h[] = "  " . $this->scrAsBold("Action") . "\t\t" . $this->scrAsBold("Comment");
656
-		$h[] = "  " . $this->scrAsBold("h") . " or " . $this->scrAsBold("help") . "\t\tDisplays this information.";
657
-		$h[] = "  " . $this->scrAsBold("q") . ", " . $this->scrAsBold("quit") . " or " . $this->scrAsBold(":q") . "\t\tExits grommunio-sync-top.";
658
-		$h[] = "  " . $this->scrAsBold("w") . " or " . $this->scrAsBold("wide") . "\t\tTries not to truncate data. Automatically done if more than 180 columns available.";
659
-		$h[] = "  " . $this->scrAsBold("f:VAL") . " or " . $this->scrAsBold("filter:VAL") . "\tOnly display connections which contain VAL. This value is case-insensitive.";
660
-		$h[] = "  " . $this->scrAsBold("f:") . " or " . $this->scrAsBold("filter:") . "\t\tWithout a search word: resets the filter.";
661
-		$h[] = "  " . $this->scrAsBold("l:STR") . " or " . $this->scrAsBold("log:STR") . "\tIssues 'less +G' on the logfile, after grepping on the optional STR.";
662
-		$h[] = "  " . $this->scrAsBold("t:STR") . " or " . $this->scrAsBold("tail:STR") . "\tIssues 'tail -f' on the logfile, grepping for optional STR.";
663
-		$h[] = "  " . $this->scrAsBold("e:STR") . " or " . $this->scrAsBold("error:STR") . "\tIssues 'tail -f' on the error logfile, grepping for optional STR.";
664
-		$h[] = "  " . $this->scrAsBold("r") . " or " . $this->scrAsBold("reset") . "\t\tResets 'wide' or 'filter'.";
665
-		$h[] = "  " . $this->scrAsBold("o:") . " or " . $this->scrAsBold("option:") . "\t\tSets display options. Valid options specified below";
666
-		$h[] = "  " . $this->scrAsBold("  p") . " or " . $this->scrAsBold("push") . "\t\tLists/not lists active and open push connections.";
667
-		$h[] = "  " . $this->scrAsBold("  a") . " or " . $this->scrAsBold("action") . "\t\tLists only active connections.";
668
-		$h[] = "  " . $this->scrAsBold("  u") . " or " . $this->scrAsBold("unknown") . "\tLists only unknown connections.";
669
-		$h[] = "  " . $this->scrAsBold("  10") . " or " . $this->scrAsBold("20") . "\t\tLists terminated connections for 10 or 20 seconds. Any other number can be used.";
670
-		$h[] = "  " . $this->scrAsBold("  d") . " or " . $this->scrAsBold("default") . "\tUses default options";
654
+		$h[] = "Actions supported by grommunio-sync-top (help page still displayed for ".$secs."secs)";
655
+		$h[] = "  ".$this->scrAsBold("Action")."\t\t".$this->scrAsBold("Comment");
656
+		$h[] = "  ".$this->scrAsBold("h")." or ".$this->scrAsBold("help")."\t\tDisplays this information.";
657
+		$h[] = "  ".$this->scrAsBold("q").", ".$this->scrAsBold("quit")." or ".$this->scrAsBold(":q")."\t\tExits grommunio-sync-top.";
658
+		$h[] = "  ".$this->scrAsBold("w")." or ".$this->scrAsBold("wide")."\t\tTries not to truncate data. Automatically done if more than 180 columns available.";
659
+		$h[] = "  ".$this->scrAsBold("f:VAL")." or ".$this->scrAsBold("filter:VAL")."\tOnly display connections which contain VAL. This value is case-insensitive.";
660
+		$h[] = "  ".$this->scrAsBold("f:")." or ".$this->scrAsBold("filter:")."\t\tWithout a search word: resets the filter.";
661
+		$h[] = "  ".$this->scrAsBold("l:STR")." or ".$this->scrAsBold("log:STR")."\tIssues 'less +G' on the logfile, after grepping on the optional STR.";
662
+		$h[] = "  ".$this->scrAsBold("t:STR")." or ".$this->scrAsBold("tail:STR")."\tIssues 'tail -f' on the logfile, grepping for optional STR.";
663
+		$h[] = "  ".$this->scrAsBold("e:STR")." or ".$this->scrAsBold("error:STR")."\tIssues 'tail -f' on the error logfile, grepping for optional STR.";
664
+		$h[] = "  ".$this->scrAsBold("r")." or ".$this->scrAsBold("reset")."\t\tResets 'wide' or 'filter'.";
665
+		$h[] = "  ".$this->scrAsBold("o:")." or ".$this->scrAsBold("option:")."\t\tSets display options. Valid options specified below";
666
+		$h[] = "  ".$this->scrAsBold("  p")." or ".$this->scrAsBold("push")."\t\tLists/not lists active and open push connections.";
667
+		$h[] = "  ".$this->scrAsBold("  a")." or ".$this->scrAsBold("action")."\t\tLists only active connections.";
668
+		$h[] = "  ".$this->scrAsBold("  u")." or ".$this->scrAsBold("unknown")."\tLists only unknown connections.";
669
+		$h[] = "  ".$this->scrAsBold("  10")." or ".$this->scrAsBold("20")."\t\tLists terminated connections for 10 or 20 seconds. Any other number can be used.";
670
+		$h[] = "  ".$this->scrAsBold("  d")." or ".$this->scrAsBold("default")."\tUses default options";
671 671
 
672 672
 		return $h;
673 673
 	}
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 	 * @return string same text as bold
681 681
 	 */
682 682
 	private function scrAsBold($text) {
683
-		return "\033[01m" . $text . "\033[0m";
683
+		return "\033[01m".$text."\033[0m";
684 684
 	}
685 685
 
686 686
 	/**
@@ -715,10 +715,10 @@  discard block
 block discarded – undo
715 715
 		if ($cutmiddle == true) {
716 716
 			$cut = ($size - 2) / 2;
717 717
 
718
-			return $this->ptStr(substr($str, 0, $cut) . ".." . substr($str, (-1) * ($cut - 1)), $size);
718
+			return $this->ptStr(substr($str, 0, $cut)."..".substr($str, (-1) * ($cut - 1)), $size);
719 719
 		}
720 720
 
721
-		return substr($str, 0, $size - 3) . ".. ";
721
+		return substr($str, 0, $size - 3).".. ";
722 722
 	}
723 723
 
724 724
 	/**
@@ -790,6 +790,6 @@  discard block
 block discarded – undo
790 790
 	 * @return
791 791
 	 */
792 792
 	private function scrPrintAt($row, $col, $text = "") {
793
-		echo "\033[" . $row . ";" . $col . "H" . $text;
793
+		echo "\033[".$row.";".$col."H".$text;
794 794
 	}
795 795
 }
Please login to merge, or discard this patch.
lib/request/validatecert.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 		$validateCert = new SyncValidateCert();
25 25
 		$validateCert->Decode(self::$decoder);
26 26
 		$cert_der = base64_decode($validateCert->certificates[0]);
27
-		$cert_pem = "-----BEGIN CERTIFICATE-----\n" . chunk_split(base64_encode($cert_der), 64, "\n") . "-----END CERTIFICATE-----\n";
27
+		$cert_pem = "-----BEGIN CERTIFICATE-----\n".chunk_split(base64_encode($cert_der), 64, "\n")."-----END CERTIFICATE-----\n";
28 28
 
29 29
 		$checkpurpose = (defined('CAINFO') && CAINFO) ? openssl_x509_checkpurpose($cert_pem, X509_PURPOSE_SMIME_SIGN, [CAINFO]) : openssl_x509_checkpurpose($cert_pem, X509_PURPOSE_SMIME_SIGN);
30 30
 		if ($checkpurpose === true) {
Please login to merge, or discard this patch.
lib/request/itemoperations.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			}
53 53
 
54 54
 			if (!$fetch && !$efc && !$move) {
55
-				SLog::Write(LOGLEVEL_DEBUG, "Unknown item operation:" . print_r($el, 1));
55
+				SLog::Write(LOGLEVEL_DEBUG, "Unknown item operation:".print_r($el, 1));
56 56
 				self::$topCollector->AnnounceInformation("Unknown operation", true);
57 57
 
58 58
 				return false;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 						if (self::$decoder->getElementStartTag(SYNC_ITEMOPERATIONS_DELETESUBFOLDERS)) {
250 250
 							$operation['deletesubfolders'] = true;
251 251
 							if (($dsf = self::$decoder->getElementContent()) !== false) {
252
-								$operation['deletesubfolders'] = (bool) $dsf;
252
+								$operation['deletesubfolders'] = (bool)$dsf;
253 253
 								if (!self::$decoder->getElementEndTag()) {
254 254
 									return false;
255 255
 								}
Please login to merge, or discard this patch.
lib/request/request.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 class Request {
11
-	public const MAXMEMORYUSAGE = 0.9;     // use max. 90% of allowed memory when syncing
11
+	public const MAXMEMORYUSAGE = 0.9; // use max. 90% of allowed memory when syncing
12 12
 	public const UNKNOWN = "unknown";
13 13
 	public const IMPERSONATE_DELIM = '#';
14 14
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 			}
141 141
 
142 142
 			if (isset(self::$base64QueryDecoded['PolKey'])) {
143
-				self::$policykey = (int) self::filterEvilInput(self::$base64QueryDecoded['PolKey'], self::NUMBERS_ONLY);
143
+				self::$policykey = (int)self::filterEvilInput(self::$base64QueryDecoded['PolKey'], self::NUMBERS_ONLY);
144 144
 			}
145 145
 
146 146
 			if (isset(self::$base64QueryDecoded['ProtVer'])) {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		else {
199 199
 			preg_replace_callback(
200 200
 				'/(\-?\d+)(.?)/',
201
-				function ($m) {
201
+				function($m) {
202 202
 					self::$memoryLimit = $m[1] * pow(1024, strpos('BKMG', $m[2])) * self::MAXMEMORYUSAGE;
203 203
 				},
204 204
 				strtoupper($memoryLimit)
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		// the policy key might be set in Request::Initialize from the base64 encoded query
223 223
 		if (!isset(self::$policykey)) {
224 224
 			if (isset(self::$headers["x-ms-policykey"])) {
225
-				self::$policykey = (int) self::filterEvilInput(self::$headers["x-ms-policykey"], self::NUMBERS_ONLY);
225
+				self::$policykey = (int)self::filterEvilInput(self::$headers["x-ms-policykey"], self::NUMBERS_ONLY);
226 226
 			}
227 227
 			else {
228 228
 				self::$policykey = 0;
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 	 * @return int
638 638
 	 */
639 639
 	public static function GetContentLength() {
640
-		return (isset(self::$headers["content-length"])) ? (int) self::$headers["content-length"] : 0;
640
+		return (isset(self::$headers["content-length"])) ? (int)self::$headers["content-length"] : 0;
641 641
 	}
642 642
 
643 643
 	/**
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 	private static function filterIP($input) {
751 751
 		$in_addr = @inet_pton($input);
752 752
 		if ($in_addr === false) {
753
-			return 'badip-' . self::filterEvilInput($input, self::HEX_EXTENDED);
753
+			return 'badip-'.self::filterEvilInput($input, self::HEX_EXTENDED);
754 754
 		}
755 755
 
756 756
 		return inet_ntop($in_addr);
@@ -799,14 +799,14 @@  discard block
 block discarded – undo
799 799
 		$polKeyLength = ord($decoded[5 + $devIdLength]); // policy key length
800 800
 		$devTypeLength = ord($decoded[6 + $devIdLength + $polKeyLength]); // device type length
801 801
 		// unpack the decoded query string values
802
-		self::$base64QueryDecoded = unpack("CProtVer/CCommand/vLocale/CDevIDLen/H" . ($devIdLength * 2) . "DevID/CPolKeyLen" . ($polKeyLength == 4 ? "/VPolKey" : "") . "/CDevTypeLen/A" . ($devTypeLength) . "DevType", $decoded);
802
+		self::$base64QueryDecoded = unpack("CProtVer/CCommand/vLocale/CDevIDLen/H".($devIdLength * 2)."DevID/CPolKeyLen".($polKeyLength == 4 ? "/VPolKey" : "")."/CDevTypeLen/A".($devTypeLength)."DevType", $decoded);
803 803
 
804 804
 		// get the command parameters
805 805
 		$pos = 7 + $devIdLength + $polKeyLength + $devTypeLength;
806 806
 		$decoded = substr($decoded, $pos);
807 807
 		while (strlen($decoded) > 0) {
808 808
 			$paramLength = ord($decoded[1]);
809
-			$unpackedParam = unpack("CParamTag/CParamLength/A" . $paramLength . "ParamValue", $decoded);
809
+			$unpackedParam = unpack("CParamTag/CParamLength/A".$paramLength."ParamValue", $decoded);
810 810
 			self::$base64QueryDecoded[ord($decoded[0])] = $unpackedParam['ParamValue'];
811 811
 			// remove parameter from decoded query string
812 812
 			$decoded = substr($decoded, 2 + $paramLength);
Please login to merge, or discard this patch.
lib/request/getitemestimate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 				elseif (self::$decoder->getElementStartTag(SYNC_CONVERSATIONMODE)) {
62 62
 					$spa->SetConversationMode(true);
63 63
 					if (($conversationmode = self::$decoder->getElementContent()) !== false) {
64
-						$spa->SetConversationMode((bool) $conversationmode);
64
+						$spa->SetConversationMode((bool)$conversationmode);
65 65
 						if (!self::$decoder->getElementEndTag()) {
66 66
 							return false;
67 67
 						}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 						$sc->AddParameter($spa, "status", SYNC_GETITEMESTSTATUS_COLLECTIONINVALID);
188 188
 					}
189 189
 
190
-					self::$topCollector->AnnounceInformation("StateNotFoundException " . $sc->GetParameter($spa, "status"), true);
190
+					self::$topCollector->AnnounceInformation("StateNotFoundException ".$sc->GetParameter($spa, "status"), true);
191 191
 				}
192 192
 				catch (StatusException $stex) {
193 193
 					if ($stex->getCode() == SYNC_GETITEMESTSTATUS_COLLECTIONINVALID) {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 					else {
197 197
 						$sc->AddParameter($spa, "status", SYNC_GETITEMESTSTATUS_SYNCSTATENOTPRIMED);
198 198
 					}
199
-					self::$topCollector->AnnounceInformation("StatusException " . $sc->GetParameter($spa, "status"), true);
199
+					self::$topCollector->AnnounceInformation("StatusException ".$sc->GetParameter($spa, "status"), true);
200 200
 				}
201 201
 			}
202 202
 		}
Please login to merge, or discard this patch.
lib/request/requestprocessor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		}
102 102
 		catch (Exception $ex) {
103 103
 			// Log 10 KB of the WBXML data
104
-			SLog::Write(LOGLEVEL_FATAL, "WBXML 10K debug data: " . Request::GetInputAsBase64(10240), false);
104
+			SLog::Write(LOGLEVEL_FATAL, "WBXML 10K debug data: ".Request::GetInputAsBase64(10240), false);
105 105
 
106 106
 			throw $ex;
107 107
 		}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		// also log WBXML in happy case
110 110
 		if (SLog::IsWbxmlDebugEnabled()) {
111 111
 			// Log 4 KB in the happy case
112
-			SLog::Write(LOGLEVEL_WBXML, "WBXML-IN : " . Request::GetInputAsBase64(4096), false);
112
+			SLog::Write(LOGLEVEL_WBXML, "WBXML-IN : ".Request::GetInputAsBase64(4096), false);
113 113
 		}
114 114
 
115 115
 		return true;
Please login to merge, or discard this patch.
lib/request/sync.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 					if (self::$decoder->getElementStartTag(SYNC_DELETESASMOVES)) {
207 207
 						$spa->SetDeletesAsMoves(true);
208 208
 						if (($dam = self::$decoder->getElementContent()) !== false) {
209
-							$spa->SetDeletesAsMoves((bool) $dam);
209
+							$spa->SetDeletesAsMoves((bool)$dam);
210 210
 							if (!self::$decoder->getElementEndTag()) {
211 211
 								return false;
212 212
 							}
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 					if (self::$decoder->getElementStartTag(SYNC_CONVERSATIONMODE)) {
250 250
 						$spa->SetConversationMode(true);
251 251
 						if (($conversationmode = self::$decoder->getElementContent()) !== false) {
252
-							$spa->SetConversationMode((bool) $conversationmode);
252
+							$spa->SetConversationMode((bool)$conversationmode);
253 253
 							if (!self::$decoder->getElementEndTag()) {
254 254
 								return false;
255 255
 							}
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 
620 620
 			if (self::$decoder->getElementStartTag(SYNC_WINDOWSIZE)) {
621 621
 				$sc->SetGlobalWindowSize(self::$decoder->getElementContent());
622
-				SLog::Write(LOGLEVEL_DEBUG, "Sync(): Global WindowSize requested: " . $sc->GetGlobalWindowSize());
622
+				SLog::Write(LOGLEVEL_DEBUG, "Sync(): Global WindowSize requested: ".$sc->GetGlobalWindowSize());
623 623
 				if (!self::$decoder->getElementEndTag()) { // SYNC_WINDOWSIZE
624 624
 					return false;
625 625
 				}
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 		}
1198 1198
 
1199 1199
 		// Stream outgoing changes
1200
-		if ($status == SYNC_STATUS_SUCCESS && $sc->GetParameter($spa, "getchanges") == true && $windowSize > 0 && (bool) $exporter) {
1200
+		if ($status == SYNC_STATUS_SUCCESS && $sc->GetParameter($spa, "getchanges") == true && $windowSize > 0 && (bool)$exporter) {
1201 1201
 			self::$topCollector->AnnounceInformation(sprintf("Streaming data of %d objects", (($changecount > $windowSize) ? $windowSize : $changecount)));
1202 1202
 
1203 1203
 			// Output message changes per folder
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 
1250 1250
 			// $progress is not an array when exporting the last message
1251 1251
 			// so we get the number to display from the streamimporter if it's available
1252
-			if ((bool) $streamimporter) {
1252
+			if ((bool)$streamimporter) {
1253 1253
 				$n = $streamimporter->GetImportedMessages();
1254 1254
 			}
1255 1255
 
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
 				}
1267 1267
 			}
1268 1268
 
1269
-			self::$topCollector->AnnounceInformation(sprintf("Outgoing %d objects%s", $n, ($n >= $windowSize) ? " of " . $changecount : ""), $this->singleFolder);
1269
+			self::$topCollector->AnnounceInformation(sprintf("Outgoing %d objects%s", $n, ($n >= $windowSize) ? " of ".$changecount : ""), $this->singleFolder);
1270 1270
 			$this->saveMultiFolderInfo("outgoing", $n);
1271 1271
 			$this->saveMultiFolderInfo("queued", $changecount);
1272 1272
 
@@ -1539,7 +1539,7 @@  discard block
 block discarded – undo
1539 1539
 							SLog::Write(LOGLEVEL_DEBUG, "SMS sync are not supported. Ignoring message.");
1540 1540
 							// TODO we should create the SMS
1541 1541
 							// return a fake serverid which we can identify later
1542
-							$actiondata["clientids"][$clientid] = self::GSYNCIGNORESMS . $clientid;
1542
+							$actiondata["clientids"][$clientid] = self::GSYNCIGNORESMS.$clientid;
1543 1543
 							$actiondata["statusids"][$clientid] = SYNC_STATUS_SUCCESS;
1544 1544
 						}
1545 1545
 						// check incoming message without logging WARN messages about errors
@@ -1630,9 +1630,9 @@  discard block
 block discarded – undo
1630 1630
 	 * @return string
1631 1631
 	 */
1632 1632
 	private function getMultiFolderInfoLine($amountOfFolders) {
1633
-		$s = $amountOfFolders . " folders";
1633
+		$s = $amountOfFolders." folders";
1634 1634
 		if (isset($this->multiFolderInfo["incoming"])) {
1635
-			$s .= ": " . $this->multiFolderInfo["incoming"] . " saved";
1635
+			$s .= ": ".$this->multiFolderInfo["incoming"]." saved";
1636 1636
 		}
1637 1637
 		if (isset($this->multiFolderInfo["outgoing"], $this->multiFolderInfo["queued"]) && $this->multiFolderInfo["outgoing"] > 0) {
1638 1638
 			$s .= sprintf(": Streamed %d out of %d", $this->multiFolderInfo["outgoing"], $this->multiFolderInfo["queued"]);
@@ -1642,10 +1642,10 @@  discard block
 block discarded – undo
1642 1642
 		}
1643 1643
 		else {
1644 1644
 			if (isset($this->multiFolderInfo["outgoing"])) {
1645
-				$s .= "/" . $this->multiFolderInfo["outgoing"] . " streamed";
1645
+				$s .= "/".$this->multiFolderInfo["outgoing"]." streamed";
1646 1646
 			}
1647 1647
 			if (isset($this->multiFolderInfo["queued"])) {
1648
-				$s .= "/" . $this->multiFolderInfo["queued"] . " queued";
1648
+				$s .= "/".$this->multiFolderInfo["queued"]." queued";
1649 1649
 			}
1650 1650
 		}
1651 1651
 		if (isset($this->multiFolderInfo["exception"])) {
Please login to merge, or discard this patch.
lib/log/syslog.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function SetPort($value) {
54 54
 		if (is_numeric($value)) {
55
-			$this->port = (int) $value;
55
+			$this->port = (int)$value;
56 56
 		}
57 57
 	}
58 58
 
@@ -97,18 +97,18 @@  discard block
 block discarded – undo
97 97
 			if (!isset($trace['file'])) {
98 98
 				continue;
99 99
 			}
100
-			if (strpos($trace['file'], REAL_BASE_PATH . 'backend/') !== false) {
100
+			if (strpos($trace['file'], REAL_BASE_PATH.'backend/') !== false) {
101 101
 				preg_match('/\/backend\/([a-zA-Z]*)/', $trace['file'], $match);
102 102
 				if (isset($match[1])) {
103
-					return $this->GetProgramName() . '/' . $match[1];
103
+					return $this->GetProgramName().'/'.$match[1];
104 104
 				}
105 105
 			}
106 106
 			elseif (basename($trace['file'], '.php') != 'slog') {
107
-				return $this->GetProgramName() . '/core';
107
+				return $this->GetProgramName().'/core';
108 108
 			}
109 109
 		}
110 110
 
111
-		return $this->GetProgramName() . '/core';
111
+		return $this->GetProgramName().'/core';
112 112
 	}
113 113
 
114 114
 	/**
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 		$log = $this->GetLogLevelString($loglevel); // Never pad syslog log because syslog log are usually read with a software.
162 162
 		// when the users differ, we need to log both
163 163
 		if (strcasecmp($this->GetAuthUser(), $this->GetUser()) == 0) {
164
-			$log .= ' [' . $this->GetUser() . ']';
164
+			$log .= ' ['.$this->GetUser().']';
165 165
 		}
166 166
 		else {
167
-			$log .= ' [' . $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() . ']';
167
+			$log .= ' ['.$this->GetAuthUser().Request::IMPERSONATE_DELIM.$this->GetUser().']';
168 168
 		}
169 169
 		if ($loglevel >= LOGLEVEL_DEVICEID) {
170
-			$log .= '[' . $this->GetDevid() . ']';
170
+			$log .= '['.$this->GetDevid().']';
171 171
 		}
172
-		$log .= ' ' . $message;
172
+		$log .= ' '.$message;
173 173
 
174 174
 		return $log;
175 175
 	}
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 			$pri = ($facility * 8) + $loglevel; // multiplying the Facility number by 8 + adding the level
192 192
 			$data = $this->BuildLogString($loglevel, $message);
193 193
 			if (strlen(trim($data)) > 0) {
194
-				$syslog_message = "<{$pri}>" . date('M d H:i:s ') . '[' . $this->GetProgramName() . ']: ' . $data;
194
+				$syslog_message = "<{$pri}>".date('M d H:i:s ').'['.$this->GetProgramName().']: '.$data;
195 195
 				socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $this->GetHost(), $this->GetPort());
196 196
 			}
197 197
 			socket_close($sock);
Please login to merge, or discard this patch.