@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // change exporterflags if we are doing a ContentExport |
108 | 108 | if ($this->folderid) { |
109 | - $this->exporterflags |= SYNC_NORMAL | SYNC_READ_STATE; |
|
109 | + $this->exporterflags |= SYNC_NORMAL|SYNC_READ_STATE; |
|
110 | 110 | |
111 | 111 | // Initial sync, we don't want deleted items. If the initial sync is chunked |
112 | 112 | // we check the change ID of the syncstate (0 at initial sync) |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if (!($this->flags & BACKEND_DISCARD_DATA)) { |
116 | 116 | SLog::Write(LOGLEVEL_DEBUG, "ExportChangesICS->Config(): syncing initial data"); |
117 | 117 | } |
118 | - $this->exporterflags |= SYNC_NO_SOFT_DELETIONS | SYNC_NO_DELETIONS; |
|
118 | + $this->exporterflags |= SYNC_NO_SOFT_DELETIONS|SYNC_NO_DELETIONS; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 |
@@ -76,8 +76,7 @@ |
||
76 | 76 | else { |
77 | 77 | $this->exporter = false; |
78 | 78 | } |
79 | - } |
|
80 | - catch (MAPIException $me) { |
|
79 | + } catch (MAPIException $me) { |
|
81 | 80 | $this->exporter = false; |
82 | 81 | // We return the general error SYNC_FSSTATUS_CODEUNKNOWN (12) which is also SYNC_STATUS_FOLDERHIERARCHYCHANGED (12) |
83 | 82 | // if this happened while doing content sync, the mobile will try to resync the folderhierarchy |
@@ -48,8 +48,7 @@ discard block |
||
48 | 48 | public function getKey($key) { |
49 | 49 | try { |
50 | 50 | return $this->redisObj->get($key); |
51 | - } |
|
52 | - catch (Exception $e) { |
|
51 | + } catch (Exception $e) { |
|
53 | 52 | SLog::Write(LOGLEVEL_ERROR, sprintf("%s->getKey(): %s", get_class($this), $e->getMessage())); |
54 | 53 | } |
55 | 54 | } |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | } |
62 | 61 | |
63 | 62 | return $this->redisObj->set($key, $value); |
64 | - } |
|
65 | - catch (Exception $e) { |
|
63 | + } catch (Exception $e) { |
|
66 | 64 | SLog::Write(LOGLEVEL_ERROR, sprintf("%s->setKey(): %s", get_class($this), $e->getMessage())); |
67 | 65 | } |
68 | 66 | } |
@@ -70,8 +68,7 @@ discard block |
||
70 | 68 | public function delKey($key) { |
71 | 69 | try { |
72 | 70 | return $this->redisObj->del($key); |
73 | - } |
|
74 | - catch (Exception $e) { |
|
71 | + } catch (Exception $e) { |
|
75 | 72 | SLog::Write(LOGLEVEL_ERROR, sprintf("%s->delKey(): %s", get_class($this), $e->getMessage())); |
76 | 73 | } |
77 | 74 | } |
@@ -984,7 +984,7 @@ |
||
984 | 984 | define("LOGLEVEL_DEVICEID", 64); |
985 | 985 | define("LOGLEVEL_WBXMLSTACK", 128); |
986 | 986 | |
987 | -define("LOGLEVEL_ALL", LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARN | LOGLEVEL_INFO | LOGLEVEL_DEBUG | LOGLEVEL_WBXML); |
|
987 | +define("LOGLEVEL_ALL", LOGLEVEL_FATAL|LOGLEVEL_ERROR|LOGLEVEL_WARN|LOGLEVEL_INFO|LOGLEVEL_DEBUG|LOGLEVEL_WBXML); |
|
988 | 988 | |
989 | 989 | define("BACKEND_DISCARD_DATA", 1); |
990 | 990 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | $asb = new BodyPreference(); |
77 | - $arr = (array) $this->bodypref; |
|
77 | + $arr = (array)$this->bodypref; |
|
78 | 78 | $arr[$type] = $asb; |
79 | 79 | $this->bodypref = $arr; |
80 | 80 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | $asb = new BodyPartPreference(); |
101 | - $arr = (array) $this->bodypartpref; |
|
101 | + $arr = (array)$this->bodypartpref; |
|
102 | 102 | $arr[$type] = $asb; |
103 | 103 | $this->bodypartpref = $arr; |
104 | 104 |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | 0x3E => "CompleteTime", // Since 12.0 |
210 | 210 | 0x3F => "DisallowNewTimeProposal", // Since 14.0 |
211 | 211 | ], |
212 | - 3 => [ // Code page 3 is no longer in use, however, tokens 05 through 17 have been defined. 20100501 |
|
212 | + 3 => [// Code page 3 is no longer in use, however, tokens 05 through 17 have been defined. 20100501 |
|
213 | 213 | 0x05 => "Notify", |
214 | 214 | 0x06 => "Notification", |
215 | 215 | 0x07 => "Version", |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | 0x11 => "Status", // Since 14.1 |
543 | 543 | 0x12 => "Data", // Since 14.1 |
544 | 544 | ], |
545 | - 0x11 => [ // Since 12.0 |
|
545 | + 0x11 => [// Since 12.0 |
|
546 | 546 | 0x05 => "BodyPreference", |
547 | 547 | 0x06 => "Type", |
548 | 548 | 0x07 => "TruncationSize", |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | 0x1A => "BodyPart", // Since 14.1 |
567 | 567 | 0x1B => "Status", // Since 14.1 |
568 | 568 | ], |
569 | - 0x12 => [ // Since 12.0 |
|
569 | + 0x12 => [// Since 12.0 |
|
570 | 570 | 0x05 => "Settings", |
571 | 571 | 0x06 => "Status", |
572 | 572 | 0x07 => "Get", |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | 0x29 => "SendDisabled", // Since 14.1 |
607 | 607 | 0x2B => "RightsManagementInformation", // Since 14.1 |
608 | 608 | ], |
609 | - 0x13 => [ // Since 12.0 |
|
609 | + 0x13 => [// Since 12.0 |
|
610 | 610 | 0x05 => "LinkId", |
611 | 611 | 0x06 => "DisplayName", |
612 | 612 | 0x07 => "IsFolder", |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | 0x0B => "ContentLength", |
617 | 617 | 0x0C => "ContentType", |
618 | 618 | ], |
619 | - 0x14 => [ // Since 12.0 |
|
619 | + 0x14 => [// Since 12.0 |
|
620 | 620 | 0x05 => "ItemOperations", |
621 | 621 | 0x06 => "Fetch", |
622 | 622 | 0x07 => "Store", |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | 0x18 => "ConversationId", // Since 14.0 |
640 | 640 | 0x19 => "MoveAlways", // Since 14.0 |
641 | 641 | ], |
642 | - 0x15 => [ // Since 14.0 |
|
642 | + 0x15 => [// Since 14.0 |
|
643 | 643 | 0x05 => "SendMail", |
644 | 644 | 0x06 => "SmartForward", |
645 | 645 | 0x07 => "SmartReply", |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | 0x12 => "Status", |
657 | 657 | 0x13 => "AccountId", // Since 14.1 |
658 | 658 | ], |
659 | - 0x16 => [ // Since 14.0 |
|
659 | + 0x16 => [// Since 14.0 |
|
660 | 660 | 0x05 => "UmCallerId", |
661 | 661 | 0x06 => "UmUserNotes", |
662 | 662 | 0x07 => "UmAttDuration", |
@@ -673,14 +673,14 @@ discard block |
||
673 | 673 | 0x12 => "FirstDayOfWeek", // Since 14.1 |
674 | 674 | 0x13 => "MeetingMessageType", // Since 14.1 |
675 | 675 | ], |
676 | - 0x17 => [ // Since 14.0 |
|
676 | + 0x17 => [// Since 14.0 |
|
677 | 677 | 0x05 => "Subject", |
678 | 678 | 0x06 => "MessageClass", |
679 | 679 | 0x07 => "LastModifiedDate", |
680 | 680 | 0x08 => "Categories", |
681 | 681 | 0x09 => "Category", |
682 | 682 | ], |
683 | - 0x18 => [ // Since 14.1 |
|
683 | + 0x18 => [// Since 14.1 |
|
684 | 684 | 0x05 => "RightsManagementSupport", |
685 | 685 | 0x06 => "RightsManagementTemplates", |
686 | 686 | 0x07 => "RightsManagementTemplate", |
@@ -15,6 +15,6 @@ |
||
15 | 15 | if ($code) { |
16 | 16 | $this->httpReturnCode = $code; |
17 | 17 | } |
18 | - parent::__construct($message, (int) $code, $previous, $logLevel); |
|
18 | + parent::__construct($message, (int)$code, $previous, $logLevel); |
|
19 | 19 | } |
20 | 20 | } |
@@ -114,7 +114,7 @@ |
||
114 | 114 | * @param mixed $message |
115 | 115 | */ |
116 | 116 | protected function afterLog($loglevel, $message) { |
117 | - if ($loglevel & (LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARN)) { |
|
117 | + if ($loglevel & (LOGLEVEL_FATAL|LOGLEVEL_ERROR|LOGLEVEL_WARN)) { |
|
118 | 118 | $data = $this->BuildLogString($loglevel, $message) . PHP_EOL; |
119 | 119 | @file_put_contents(LOGERRORFILE, $data, FILE_APPEND); |
120 | 120 | } |
@@ -52,7 +52,7 @@ |
||
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 |
@@ -1372,8 +1372,7 @@ discard block |
||
1372 | 1372 | |
1373 | 1373 | // if the search range is set limit the result to it, otherwise return all found messages |
1374 | 1374 | $rows = (is_array($searchRange) && isset($searchRange[0], $searchRange[1])) ? |
1375 | - mapi_table_queryrows($table, [PR_ENTRYID], $searchRange[0], $searchRange[1] - $searchRange[0] + 1) : |
|
1376 | - mapi_table_queryrows($table, [PR_ENTRYID], 0, SEARCH_MAXRESULTS); |
|
1375 | + mapi_table_queryrows($table, [PR_ENTRYID], $searchRange[0], $searchRange[1] - $searchRange[0] + 1) : mapi_table_queryrows($table, [PR_ENTRYID], 0, SEARCH_MAXRESULTS); |
|
1377 | 1376 | |
1378 | 1377 | $cnt = count($rows); |
1379 | 1378 | $items['searchtotal'] = $cnt; |
@@ -1977,12 +1976,12 @@ discard block |
||
1977 | 1976 | mapi_setprops($stateMessage, [PR_DISPLAY_NAME => $messageName, PR_MESSAGE_CLASS => 'IPM.Note.GrommunioState']); |
1978 | 1977 | } |
1979 | 1978 | if (isset($stateMessage)) { |
1980 | - $jsonEncodedState = is_object($state) || is_array($state) ? json_encode($state, JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_UNICODE) : $state; |
|
1979 | + $jsonEncodedState = is_object($state) || is_array($state) ? json_encode($state, JSON_INVALID_UTF8_IGNORE|JSON_UNESCAPED_UNICODE) : $state; |
|
1981 | 1980 | |
1982 | 1981 | $encodedState = base64_encode($jsonEncodedState); |
1983 | 1982 | $encodedStateLength = strlen($encodedState); |
1984 | 1983 | mapi_setprops($stateMessage, [PR_LAST_VERB_EXECUTED => is_int($counter) ? $counter : 0]); |
1985 | - $stream = mapi_openproperty($stateMessage, PR_BODY, IID_IStream, STGM_DIRECT, MAPI_CREATE | MAPI_MODIFY); |
|
1984 | + $stream = mapi_openproperty($stateMessage, PR_BODY, IID_IStream, STGM_DIRECT, MAPI_CREATE|MAPI_MODIFY); |
|
1986 | 1985 | mapi_stream_setsize($stream, $encodedStateLength); |
1987 | 1986 | mapi_stream_write($stream, $encodedState); |
1988 | 1987 | mapi_stream_commit($stream); |
@@ -2077,7 +2076,7 @@ discard block |
||
2077 | 2076 | private function adviseStoreToSink($store) { |
2078 | 2077 | // check if we already advised the store |
2079 | 2078 | if (!in_array($store, $this->changesSinkStores)) { |
2080 | - mapi_msgstore_advise($store, null, fnevObjectModified | fnevObjectCreated | fnevObjectMoved | fnevObjectDeleted, $this->changesSink); |
|
2079 | + mapi_msgstore_advise($store, null, fnevObjectModified|fnevObjectCreated|fnevObjectMoved|fnevObjectDeleted, $this->changesSink); |
|
2081 | 2080 | |
2082 | 2081 | if (mapi_last_hresult()) { |
2083 | 2082 | SLog::Write(LOGLEVEL_WARN, sprintf("Grommunio->adviseStoreToSink(): failed to advised store '%s' with code 0x%X. Polling will be performed.", $store, mapi_last_hresult())); |
@@ -2551,7 +2550,7 @@ discard block |
||
2551 | 2550 | $resOr, |
2552 | 2551 | [RES_CONTENT, |
2553 | 2552 | [ |
2554 | - FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, |
|
2553 | + FUZZYLEVEL => FL_SUBSTRING|FL_IGNORECASE, |
|
2555 | 2554 | ULPROPTAG => $property, |
2556 | 2555 | VALUE => u2w($term), |
2557 | 2556 | ], |
@@ -163,8 +163,7 @@ discard block |
||
163 | 163 | throw new ServiceUnavailableException("Error connecting to KC (login)"); |
164 | 164 | } |
165 | 165 | } |
166 | - } |
|
167 | - catch (MAPIException $ex) { |
|
166 | + } catch (MAPIException $ex) { |
|
168 | 167 | throw new AuthenticationRequiredException($ex->getDisplayMessage()); |
169 | 168 | } |
170 | 169 | |
@@ -1660,8 +1659,7 @@ discard block |
||
1660 | 1659 | if (isset($stateMessageProps[PR_LAST_MODIFICATION_TIME])) { |
1661 | 1660 | return $stateMessageProps[PR_LAST_MODIFICATION_TIME]; |
1662 | 1661 | } |
1663 | - } |
|
1664 | - catch (StateNotFoundException $e) { |
|
1662 | + } catch (StateNotFoundException $e) { |
|
1665 | 1663 | } |
1666 | 1664 | |
1667 | 1665 | return "0"; |
@@ -1966,8 +1964,7 @@ discard block |
||
1966 | 1964 | |
1967 | 1965 | try { |
1968 | 1966 | $stateMessage = $this->getStateMessage($devid, $type, $key, $counter); |
1969 | - } |
|
1970 | - catch (StateNotFoundException $e) { |
|
1967 | + } catch (StateNotFoundException $e) { |
|
1971 | 1968 | // if message is not available, try to create a new one |
1972 | 1969 | $stateMessage = mapi_folder_createmessage($this->stateFolder, MAPI_ASSOCIATED); |
1973 | 1970 | SLog::Write(LOGLEVEL_DEBUG, sprintf("Grommunio->setStateMessage(): mapi_folder_createmessage 0x%08X", mapi_last_hresult())); |