@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $expr = $qb->expr(); |
| 246 | - $pf = '' . $this->default_select_alias . '.'; |
|
| 246 | + $pf = ''.$this->default_select_alias.'.'; |
|
| 247 | 247 | |
| 248 | 248 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 249 | 249 | $qb->selectAlias('u.user_id', 'viewer_userid') |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | ->leftJoin( |
| 256 | 256 | $this->default_select_alias, CoreRequestBuilder::TABLE_MEMBERS, 'u', |
| 257 | 257 | $expr->andX( |
| 258 | - $expr->eq('u.circle_id', $pf . 'unique_id'), |
|
| 258 | + $expr->eq('u.circle_id', $pf.'unique_id'), |
|
| 259 | 259 | $expr->eq('u.user_id', $qb->createNamedParameter($userId)), |
| 260 | 260 | $expr->eq('u.instance', $qb->createNamedParameter($instanceId)), |
| 261 | 261 | $expr->eq('u.user_type', $qb->createNamedParameter($type)) |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | $expr = $qb->expr(); |
| 280 | - $pf = $this->default_select_alias . '.'; |
|
| 280 | + $pf = $this->default_select_alias.'.'; |
|
| 281 | 281 | |
| 282 | 282 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 283 | 283 | $qb->selectAlias('o.user_id', 'owner_userid') |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | ->leftJoin( |
| 288 | 288 | $this->default_select_alias, CoreRequestBuilder::TABLE_MEMBERS, 'o', |
| 289 | 289 | $expr->andX( |
| 290 | - $expr->eq('o.circle_id', $pf . 'unique_id'), |
|
| 290 | + $expr->eq('o.circle_id', $pf.'unique_id'), |
|
| 291 | 291 | $expr->eq('o.level', $qb->createNamedParameter(Member::LEVEL_OWNER)), |
| 292 | 292 | $expr->eq('o.user_type', $qb->createNamedParameter(Member::TYPE_USER)) |
| 293 | 293 | ) |
@@ -344,8 +344,8 @@ discard block |
||
| 344 | 344 | $expr = $qb->expr(); |
| 345 | 345 | |
| 346 | 346 | if ($pf === '') { |
| 347 | - $p = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 348 | - $qb->andWhere($expr->gte($p . 'level', $qb->createNamedParameter($level))); |
|
| 347 | + $p = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 348 | + $qb->andWhere($expr->gte($p.'level', $qb->createNamedParameter($level))); |
|
| 349 | 349 | |
| 350 | 350 | return; |
| 351 | 351 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ($p === 'g' && !$this->leftJoinedNCGroupAndUser) { |
| 374 | 374 | continue; |
| 375 | 375 | } |
| 376 | - $orX->add($expr->gte($p . '.level', $qb->createNamedParameter($level))); |
|
| 376 | + $orX->add($expr->gte($p.'.level', $qb->createNamedParameter($level))); |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | return $orX; |
@@ -388,12 +388,12 @@ discard block |
||
| 388 | 388 | protected function limitToMembersAndAlmost(IQueryBuilder &$qb) { |
| 389 | 389 | $expr = $qb->expr(); |
| 390 | 390 | |
| 391 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 391 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 392 | 392 | |
| 393 | 393 | $orX = $expr->orX(); |
| 394 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(Member::STATUS_MEMBER))); |
|
| 395 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(Member::STATUS_INVITED))); |
|
| 396 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(Member::STATUS_REQUEST))); |
|
| 394 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(Member::STATUS_MEMBER))); |
|
| 395 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(Member::STATUS_INVITED))); |
|
| 396 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(Member::STATUS_REQUEST))); |
|
| 397 | 397 | |
| 398 | 398 | $qb->andWhere($orX); |
| 399 | 399 | } |
@@ -406,8 +406,8 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | private function limitToDBField(IQueryBuilder &$qb, $field, $value) { |
| 408 | 408 | $expr = $qb->expr(); |
| 409 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 410 | - $qb->andWhere($expr->eq($pf . $field, $qb->createNamedParameter($value))); |
|
| 409 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 410 | + $qb->andWhere($expr->eq($pf.$field, $qb->createNamedParameter($value))); |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
@@ -418,8 +418,8 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | private function limitToDBFieldOrGreater(IQueryBuilder &$qb, $field, $value) { |
| 420 | 420 | $expr = $qb->expr(); |
| 421 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 422 | - $qb->andWhere($expr->gte($pf . $field, $qb->createNamedParameter($value))); |
|
| 421 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 422 | + $qb->andWhere($expr->gte($pf.$field, $qb->createNamedParameter($value))); |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | |
@@ -434,9 +434,9 @@ discard block |
||
| 434 | 434 | protected function limitToNCGroupUser(IQueryBuilder $qb, $userId = '') { |
| 435 | 435 | $expr = $qb->expr(); |
| 436 | 436 | |
| 437 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 437 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 438 | 438 | |
| 439 | - $and = $expr->andX($expr->eq($pf . 'user_id', 'ncgu.gid')); |
|
| 439 | + $and = $expr->andX($expr->eq($pf.'user_id', 'ncgu.gid')); |
|
| 440 | 440 | if ($userId !== '') { |
| 441 | 441 | $and->add($expr->eq('ncgu.uid', $qb->createNamedParameter($userId))); |
| 442 | 442 | } else { |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | $expr = $qb->expr(); |
| 462 | - $pf = $this->default_select_alias . '.'; |
|
| 462 | + $pf = $this->default_select_alias.'.'; |
|
| 463 | 463 | |
| 464 | 464 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 465 | 465 | $qb->selectAlias('lc.type', 'circle_type') |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | ->selectAlias('lc.settings', 'circle_settings') |
| 468 | 468 | ->leftJoin( |
| 469 | 469 | $this->default_select_alias, CoreRequestBuilder::TABLE_CIRCLES, 'lc', |
| 470 | - $expr->eq($pf . 'circle_id', 'lc.unique_id') |
|
| 470 | + $expr->eq($pf.'circle_id', 'lc.unique_id') |
|
| 471 | 471 | ); |
| 472 | 472 | } |
| 473 | 473 | |
@@ -354,7 +354,7 @@ |
||
| 354 | 354 | |
| 355 | 355 | |
| 356 | 356 | /** |
| 357 | - * @param array $circles |
|
| 357 | + * @param Circle[] $circles |
|
| 358 | 358 | */ |
| 359 | 359 | public function synchronizeCircles(array $circles): void { |
| 360 | 360 | $event = new GSEvent(GSEvent::GLOBAL_SYNC, true); |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | } else { |
| 146 | 146 | // $gs->verify($event); // needed ? as we check event on the 'master' of the circle |
| 147 | 147 | $this->confirmEvent($event); |
| 148 | - $this->miscService->log('confirmed: ' . json_encode($event)); |
|
| 148 | + $this->miscService->log('confirmed: '.json_encode($event)); |
|
| 149 | 149 | // $gs->manage($event); // needed ? as we manage it throw the confirmEvent |
| 150 | 150 | } |
| 151 | 151 | } catch (Exception $e) { |
| 152 | 152 | $this->miscService->log( |
| 153 | - get_class($e) . ' on new event: ' . $e->getMessage() . ' - ' . json_encode($event), 1 |
|
| 153 | + get_class($e).' on new event: '.$e->getMessage().' - '.json_encode($event), 1 |
|
| 154 | 154 | ); |
| 155 | 155 | throw $e; |
| 156 | 156 | } |
@@ -239,13 +239,13 @@ discard block |
||
| 239 | 239 | $request->setDataSerialize($event); |
| 240 | 240 | |
| 241 | 241 | $result = $this->retrieveJson($request); |
| 242 | - $this->miscService->log('result ' . json_encode($result)); |
|
| 242 | + $this->miscService->log('result '.json_encode($result)); |
|
| 243 | 243 | if ($this->getInt('status', $result) === 0) { |
| 244 | 244 | throw new GlobalScaleEventException($this->get('error', $result)); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | $updatedData = $this->getArray('event', $result); |
| 248 | - $this->miscService->log('updatedEvent: ' . json_encode($updatedData)); |
|
| 248 | + $this->miscService->log('updatedEvent: '.json_encode($updatedData)); |
|
| 249 | 249 | if (!empty($updatedData)) { |
| 250 | 250 | $updated = new GSEvent(); |
| 251 | 251 | try { |
@@ -167,12 +167,12 @@ discard block |
||
| 167 | 167 | try { |
| 168 | 168 | $gs = OC::$server->query($class); |
| 169 | 169 | if (!$gs instanceof AGlobalScaleEvent) { |
| 170 | - throw new GlobalScaleEventException($class . ' not an AGlobalScaleEvent'); |
|
| 170 | + throw new GlobalScaleEventException($class.' not an AGlobalScaleEvent'); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | return $gs; |
| 174 | 174 | } catch (QueryException $e) { |
| 175 | - throw new GlobalScaleEventException('AGlobalScaleEvent ' . $class . ' not found'); |
|
| 175 | + throw new GlobalScaleEventException('AGlobalScaleEvent '.$class.' not found'); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $key = $this->configService->getSystemValue('instanceid'); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - return md5('gskey:' . $key); |
|
| 191 | + return md5('gskey:'.$key); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $instances = $this->retrieveJson($request); |
| 234 | 234 | } catch (RequestContentException | RequestNetworkException | RequestResultSizeException | RequestServerException | RequestResultNotJsonException $e) { |
| 235 | 235 | $this->miscService->log( |
| 236 | - 'Issue while retrieving instances from lookup: ' . get_class($e) . ' ' . $e->getMessage() |
|
| 236 | + 'Issue while retrieving instances from lookup: '.get_class($e).' '.$e->getMessage() |
|
| 237 | 237 | ); |
| 238 | 238 | |
| 239 | 239 | return []; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $className = $event->getType(); |
| 261 | 261 | if (substr($className, 0, 25) !== '\OCA\Circles\GlobalScale\\' || strpos($className, '.')) { |
| 262 | 262 | throw new GlobalScaleEventException( |
| 263 | - $className . ' does not seems to be a secured AGlobalScaleEvent' |
|
| 263 | + $className.' does not seems to be a secured AGlobalScaleEvent' |
|
| 264 | 264 | ); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $this->sendMailExistingShares($template, $author, $recipient); |
| 178 | 178 | $this->sendPasswordExistingShares($author, $recipient, $password); |
| 179 | 179 | } catch (Exception $e) { |
| 180 | - $this->miscService->log('Failed to send mail about existing share ' . $e->getMessage()); |
|
| 180 | + $this->miscService->log('Failed to send mail about existing share '.$e->getMessage()); |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author; |
| 328 | 328 | $authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null; |
| 329 | 329 | |
| 330 | - $this->miscService->log("Sending password mail about existing files to '" . $email . "'", 0); |
|
| 330 | + $this->miscService->log("Sending password mail about existing files to '".$email."'", 0); |
|
| 331 | 331 | |
| 332 | 332 | $plainBodyPart = $this->l10n->t( |
| 333 | 333 | "%1\$s shared multiple files with you.\nYou should have already received a separate mail with a link to access them.\n", |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 370 | 370 | if ($authorEmail !== null) { |
| 371 | 371 | $message->setReplyTo([$authorEmail => $authorName]); |
| 372 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 372 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 373 | 373 | } else { |
| 374 | 374 | $emailTemplate->addFooter(); |
| 375 | 375 | } |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | RequestServerException | |
| 99 | 99 | RequestResultNotJsonException $e |
| 100 | 100 | ) { |
| 101 | - $this->miscService->log('Issue while retrieving instances from lookup: ' . get_class($e) . ' ' . $e->getMessage()); |
|
| 101 | + $this->miscService->log('Issue while retrieving instances from lookup: '.get_class($e).' '.$e->getMessage()); |
|
| 102 | 102 | |
| 103 | 103 | return []; |
| 104 | 104 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public function onDeleteCard(GenericEvent $event) { |
| 159 | 159 | $davCard = $this->generateDavCard($event, true); |
| 160 | 160 | |
| 161 | - $this->miscService->log('Deleting Card: ' . json_encode($davCard), 1); |
|
| 161 | + $this->miscService->log('Deleting Card: '.json_encode($davCard), 1); |
|
| 162 | 162 | $this->membersRequest->removeMembersByContactId($davCard->getUniqueId(), Member::TYPE_USER); |
| 163 | 163 | $this->manageDeprecatedCircles($davCard->getAddressBookId()); |
| 164 | 164 | $this->manageDeprecatedMembers($davCard); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | private function generateDavCardFromCard(int $bookId, array $card): DavCard { |
| 201 | 201 | $this->miscService->log( |
| 202 | - 'generating DavCard Model from book=' . $bookId . ' from ' . json_encode($card), 0 |
|
| 202 | + 'generating DavCard Model from book='.$bookId.' from '.json_encode($card), 0 |
|
| 203 | 203 | ); |
| 204 | 204 | |
| 205 | 205 | $davCard = new DavCard(); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $davCard->setOwner($this->getOwnerFromAddressBook($bookId)); |
| 210 | 210 | $davCard->importFromDav($card['carddata']); |
| 211 | 211 | |
| 212 | - $this->miscService->log('generated DavCard Model: ' . json_encode($davCard), 0); |
|
| 212 | + $this->miscService->log('generated DavCard Model: '.json_encode($davCard), 0); |
|
| 213 | 213 | |
| 214 | 214 | return $davCard; |
| 215 | 215 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | */ |
| 222 | 222 | private function manageDavCard(DavCard $davCard) { |
| 223 | - $this->miscService->log('Updating Card: ' . json_encode($davCard), 1); |
|
| 223 | + $this->miscService->log('Updating Card: '.json_encode($davCard), 1); |
|
| 224 | 224 | $this->manageCircles($davCard); |
| 225 | 225 | $this->manageContact($davCard); |
| 226 | 226 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | private function manageDeprecatedMembers(DavCard $davCard) { |
| 256 | 256 | $this->miscService->log( |
| 257 | - 'Managing deprecated circles memberships from DavCard Model: ' . json_encode($davCard), 0 |
|
| 257 | + 'Managing deprecated circles memberships from DavCard Model: '.json_encode($davCard), 0 |
|
| 258 | 258 | ); |
| 259 | 259 | |
| 260 | 260 | $circles = array_map( |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | $members = $this->membersRequest->getMembersByContactId($davCard->getUniqueId()); |
| 267 | 267 | $this->miscService->log( |
| 268 | - 'Found ' . sizeof($members) . ' memberships with contactId=' . $davCard->getUniqueId(), 0 |
|
| 268 | + 'Found '.sizeof($members).' memberships with contactId='.$davCard->getUniqueId(), 0 |
|
| 269 | 269 | ); |
| 270 | 270 | |
| 271 | 271 | foreach ($members as $member) { |
| 272 | 272 | if (!in_array($member->getCircleId(), $circles)) { |
| 273 | 273 | $this->miscService->log( |
| 274 | - 'Removing membership ' . $member->getMemberId() . ' from ' . $member->getCircleId(), 0 |
|
| 274 | + 'Removing membership '.$member->getMemberId().' from '.$member->getCircleId(), 0 |
|
| 275 | 275 | ); |
| 276 | 276 | $this->membersRequest->removeMember($member); |
| 277 | 277 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | - $davCard->setUserId($davCard->getOwner() . ':' . $davCard->getContactId()); |
|
| 353 | + $davCard->setUserId($davCard->getOwner().':'.$davCard->getContactId()); |
|
| 354 | 354 | |
| 355 | 355 | return DavCard::TYPE_CONTACT; |
| 356 | 356 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | ); |
| 396 | 396 | |
| 397 | 397 | $this->miscService->log( |
| 398 | - 'manage Circles from DavCard: ' . json_encode($fromCard) . ' - current: ' . json_encode($current) |
|
| 398 | + 'manage Circles from DavCard: '.json_encode($fromCard).' - current: '.json_encode($current) |
|
| 399 | 399 | ); |
| 400 | 400 | |
| 401 | 401 | $this->manageNewCircles($davCard, $fromCard, $current); |
@@ -418,14 +418,14 @@ discard block |
||
| 418 | 418 | |
| 419 | 419 | $user = $this->userManager->get($davCard->getOwner()); |
| 420 | 420 | $circle = new Circle( |
| 421 | - $this->configService->contactsBackendType(), $group . ' - ' . $user->getDisplayName() |
|
| 421 | + $this->configService->contactsBackendType(), $group.' - '.$user->getDisplayName() |
|
| 422 | 422 | ); |
| 423 | 423 | $circle->setAltName($group); |
| 424 | 424 | $circle->setContactAddressBook($davCard->getAddressBookId()); |
| 425 | 425 | $circle->setContactGroupName($group); |
| 426 | 426 | |
| 427 | 427 | $this->miscService->log( |
| 428 | - 'creating new Circle: ' . json_encode($circle) . ', with owner=' . $davCard->getOwner(), 0 |
|
| 428 | + 'creating new Circle: '.json_encode($circle).', with owner='.$davCard->getOwner(), 0 |
|
| 429 | 429 | ); |
| 430 | 430 | try { |
| 431 | 431 | $this->circlesRequest->createCircle($circle); |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | $member->setLevel(Member::LEVEL_OWNER); |
| 434 | 434 | $member->setStatus(Member::STATUS_MEMBER); |
| 435 | 435 | |
| 436 | - $this->miscService->log('creating new Member: ' . json_encode($member), 0); |
|
| 436 | + $this->miscService->log('creating new Member: '.json_encode($member), 0); |
|
| 437 | 437 | try { |
| 438 | 438 | $this->membersRequest->createMember($member); |
| 439 | 439 | } catch (MemberAlreadyExistsException $e) { |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | * @param DavCard $davCard |
| 449 | 449 | */ |
| 450 | 450 | private function assignCirclesToCard(DavCard $davCard) { |
| 451 | - $this->miscService->log('assigning Circles to DavCard Model: ' . json_encode($davCard), 0); |
|
| 451 | + $this->miscService->log('assigning Circles to DavCard Model: '.json_encode($davCard), 0); |
|
| 452 | 452 | foreach ($davCard->getGroups() as $group) { |
| 453 | 453 | try { |
| 454 | 454 | $davCard->addCircle( |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - $this->miscService->log('assigned Circles to DavCard Model: ' . json_encode($davCard), 0); |
|
| 461 | + $this->miscService->log('assigned Circles to DavCard Model: '.json_encode($davCard), 0); |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | |
@@ -503,12 +503,12 @@ discard block |
||
| 503 | 503 | * @return string |
| 504 | 504 | */ |
| 505 | 505 | public function getOwnerFromAddressBook(int $bookId): string { |
| 506 | - $this->miscService->log('Retrieving Owner from book:' . $bookId, 0); |
|
| 506 | + $this->miscService->log('Retrieving Owner from book:'.$bookId, 0); |
|
| 507 | 507 | $data = $this->cardDavBackend->getAddressBookById($bookId); |
| 508 | 508 | |
| 509 | 509 | // let's assume the format is principals/users/OWNER |
| 510 | 510 | $owner = substr($data['principaluri'], 17); |
| 511 | - $this->miscService->log('Retrieved Owner:' . $owner, 0); |
|
| 511 | + $this->miscService->log('Retrieved Owner:'.$owner, 0); |
|
| 512 | 512 | |
| 513 | 513 | return $owner; |
| 514 | 514 | } |
@@ -525,12 +525,12 @@ discard block |
||
| 525 | 525 | $this->manageDeprecatedContacts(); |
| 526 | 526 | $this->manageDeprecatedCircles(); |
| 527 | 527 | $users = $this->userManager->search(''); |
| 528 | - $this->miscService->log('initiating migration for ' . sizeof($users) . ' users', 0); |
|
| 528 | + $this->miscService->log('initiating migration for '.sizeof($users).' users', 0); |
|
| 529 | 529 | foreach ($users as $user) { |
| 530 | - $this->miscService->log('retrieving books for user=' . $user->getUID(), 0); |
|
| 531 | - $books = $this->cardDavBackend->getAddressBooksForUser('principals/users/' . $user->getUID()); |
|
| 530 | + $this->miscService->log('retrieving books for user='.$user->getUID(), 0); |
|
| 531 | + $books = $this->cardDavBackend->getAddressBooksForUser('principals/users/'.$user->getUID()); |
|
| 532 | 532 | |
| 533 | - $this->miscService->log('initiating migration for user=' . $user->getUID(), 0); |
|
| 533 | + $this->miscService->log('initiating migration for user='.$user->getUID(), 0); |
|
| 534 | 534 | foreach ($books as $book) { |
| 535 | 535 | $this->migrateBook($book['id']); |
| 536 | 536 | } |
@@ -543,16 +543,16 @@ discard block |
||
| 543 | 543 | private function manageDeprecatedContacts() { |
| 544 | 544 | $contacts = $this->membersRequest->getMembersByContactId(); |
| 545 | 545 | $this->miscService->log( |
| 546 | - 'Managing Deprecated Contacts, checking ' . sizeof($contacts) . ' known contacts in database', 0 |
|
| 546 | + 'Managing Deprecated Contacts, checking '.sizeof($contacts).' known contacts in database', 0 |
|
| 547 | 547 | ); |
| 548 | 548 | |
| 549 | 549 | foreach ($contacts as $contact) { |
| 550 | 550 | try { |
| 551 | 551 | $this->getDavCardFromMember($contact); |
| 552 | - $this->miscService->log('Contact is not deprecated: ' . json_encode($contact)); |
|
| 552 | + $this->miscService->log('Contact is not deprecated: '.json_encode($contact)); |
|
| 553 | 553 | } catch (MemberDoesNotExistException $e) { |
| 554 | 554 | $this->miscService->log( |
| 555 | - 'Contact is deprecated and will be removed: ' . json_encode($contact) |
|
| 555 | + 'Contact is deprecated and will be removed: '.json_encode($contact) |
|
| 556 | 556 | ); |
| 557 | 557 | $this->membersRequest->removeMember($contact); |
| 558 | 558 | } |
@@ -567,12 +567,12 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | private function manageDeprecatedCircles(int $bookId = 0) { |
| 569 | 569 | $knownBooks = [$bookId]; |
| 570 | - $this->miscService->log('Managing Deprecated Circles, using bookId: ' . $bookId, 0); |
|
| 570 | + $this->miscService->log('Managing Deprecated Circles, using bookId: '.$bookId, 0); |
|
| 571 | 571 | |
| 572 | 572 | if ($bookId > 0) { |
| 573 | 573 | $knownBooks = []; |
| 574 | 574 | $contacts = $this->membersRequest->getMembersByContactId(); |
| 575 | - $this->miscService->log(sizeof($contacts) . ' known members as contacts in Circles DB', 0); |
|
| 575 | + $this->miscService->log(sizeof($contacts).' known members as contacts in Circles DB', 0); |
|
| 576 | 576 | |
| 577 | 577 | foreach ($contacts as $contact) { |
| 578 | 578 | list($bookId,) = explode('/', $contact->getContactId(), 2); |
@@ -584,17 +584,17 @@ discard block |
||
| 584 | 584 | } |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - $this->miscService->log('Known books: ' . json_encode($knownBooks), 0); |
|
| 587 | + $this->miscService->log('Known books: '.json_encode($knownBooks), 0); |
|
| 588 | 588 | foreach ($knownBooks as $bookId) { |
| 589 | - $this->miscService->log('retrieving local Circles data for bookId=' . $bookId, 0); |
|
| 589 | + $this->miscService->log('retrieving local Circles data for bookId='.$bookId, 0); |
|
| 590 | 590 | $circles = $this->circlesRequest->getFromContactBook($bookId); |
| 591 | 591 | $this->miscService->log( |
| 592 | - 'Known circles for bookId=' . $bookId . ': ' . json_encode($circles), 0 |
|
| 592 | + 'Known circles for bookId='.$bookId.': '.json_encode($circles), 0 |
|
| 593 | 593 | ); |
| 594 | 594 | |
| 595 | 595 | $fromBook = $this->getExistingCirclesFromBook($bookId); |
| 596 | 596 | $this->miscService->log( |
| 597 | - 'Generated circles from bookId=' . $bookId . ': ' . json_encode($fromBook), 0 |
|
| 597 | + 'Generated circles from bookId='.$bookId.': '.json_encode($fromBook), 0 |
|
| 598 | 598 | ); |
| 599 | 599 | |
| 600 | 600 | foreach ($circles as $circle) { |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | $this->miscService->log( |
| 606 | - $circle->getUniqueId() . ' is a deprecated Circle and will be destroyed', 0 |
|
| 606 | + $circle->getUniqueId().' is a deprecated Circle and will be destroyed', 0 |
|
| 607 | 607 | ); |
| 608 | 608 | |
| 609 | 609 | $this->membersRequest->removeAllFromCircle($circle->getUniqueId()); |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | $cards = $this->cardDavBackend->getCards($bookId); |
| 626 | 626 | |
| 627 | 627 | $this->miscService->log( |
| 628 | - 'retrieving existing circles from bookId=' . $bookId . ' in ' . sizeof($cards) . ' cards', 0 |
|
| 628 | + 'retrieving existing circles from bookId='.$bookId.' in '.sizeof($cards).' cards', 0 |
|
| 629 | 629 | ); |
| 630 | 630 | foreach ($cards as $card) { |
| 631 | 631 | $davCard = $this->generateDavCardFromCard($bookId, $card); |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | $circles = array_merge($circles, $davCard->getCircles()); |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | - $this->miscService->log('Found ' . sizeof($circles) . ' Circles from book=' . $bookId, 0); |
|
| 636 | + $this->miscService->log('Found '.sizeof($circles).' Circles from book='.$bookId, 0); |
|
| 637 | 637 | $existing = array_unique( |
| 638 | 638 | array_map( |
| 639 | 639 | function(Circle $circle) { |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | ); |
| 644 | 644 | |
| 645 | 645 | $this->miscService->log( |
| 646 | - 'retrieved existing circles from book=' . $bookId . ': ' . json_encode($existing), 0 |
|
| 646 | + 'retrieved existing circles from book='.$bookId.': '.json_encode($existing), 0 |
|
| 647 | 647 | ); |
| 648 | 648 | |
| 649 | 649 | return $existing; |
@@ -658,14 +658,14 @@ discard block |
||
| 658 | 658 | */ |
| 659 | 659 | public function getDavCardFromMember(Member $contact): DavCard { |
| 660 | 660 | list($bookId, $cardUri) = explode('/', $contact->getContactId(), 2); |
| 661 | - $this->miscService->log('Retrieving DavCard from book:' . $bookId . ', uri:' . $cardUri, 0); |
|
| 661 | + $this->miscService->log('Retrieving DavCard from book:'.$bookId.', uri:'.$cardUri, 0); |
|
| 662 | 662 | |
| 663 | 663 | $cards = $this->cardDavBackend->getCards($bookId); |
| 664 | - $this->miscService->log('Book contains ' . sizeof($cards) . ' cards', 0); |
|
| 664 | + $this->miscService->log('Book contains '.sizeof($cards).' cards', 0); |
|
| 665 | 665 | foreach ($cards as $card) { |
| 666 | 666 | if ($card['uri'] === $cardUri) { |
| 667 | 667 | $davCard = $this->generateDavCardFromCard($bookId, $card); |
| 668 | - $this->miscService->log('Retrieved DavCard: ' . json_encode($card)); |
|
| 668 | + $this->miscService->log('Retrieved DavCard: '.json_encode($card)); |
|
| 669 | 669 | |
| 670 | 670 | return $davCard; |
| 671 | 671 | } |
@@ -683,11 +683,11 @@ discard block |
||
| 683 | 683 | return; |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | - $this->miscService->log('migrating book: ' . $bookId, 0); |
|
| 686 | + $this->miscService->log('migrating book: '.$bookId, 0); |
|
| 687 | 687 | $owner = $this->getOwnerFromAddressBook($bookId); |
| 688 | 688 | |
| 689 | 689 | $cards = $this->cardDavBackend->getCards($bookId); |
| 690 | - $this->miscService->log('found ' . sizeof($cards) . 'cards from book=' . $bookId, 0); |
|
| 690 | + $this->miscService->log('found '.sizeof($cards).'cards from book='.$bookId, 0); |
|
| 691 | 691 | |
| 692 | 692 | foreach ($cards as $card) { |
| 693 | 693 | $davCard = new DavCard(); |