@@ -1101,6 +1101,9 @@ |
||
| 1101 | 1101 | return $share; |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | + /** |
|
| 1105 | + * @param IShare $share |
|
| 1106 | + */ |
|
| 1104 | 1107 | protected function checkExpireDate($share) { |
| 1105 | 1108 | if ($share->getExpirationDate() !== null && |
| 1106 | 1109 | $share->getExpirationDate() <= new \DateTime()) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | if ($fullId === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) { |
| 323 | 323 | $expirationDate = new \DateTime(); |
| 324 | - $expirationDate->setTime(0,0,0); |
|
| 324 | + $expirationDate->setTime(0, 0, 0); |
|
| 325 | 325 | $expirationDate->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
| 326 | 326 | } |
| 327 | 327 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | $date = new \DateTime(); |
| 335 | 335 | $date->setTime(0, 0, 0); |
| 336 | - $date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D')); |
|
| 336 | + $date->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
|
| 337 | 337 | if ($date < $expirationDate) { |
| 338 | 338 | $message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]); |
| 339 | 339 | throw new GenericShareException($message, $message, 404); |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | */ |
| 387 | 387 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_USER); |
| 388 | 388 | $existingShares = $provider->getSharesByPath($share->getNode()); |
| 389 | - foreach($existingShares as $existingShare) { |
|
| 389 | + foreach ($existingShares as $existingShare) { |
|
| 390 | 390 | // Ignore if it is the same share |
| 391 | 391 | try { |
| 392 | 392 | if ($existingShare->getFullId() === $share->getFullId()) { |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_GROUP); |
| 445 | 445 | $existingShares = $provider->getSharesByPath($share->getNode()); |
| 446 | - foreach($existingShares as $existingShare) { |
|
| 446 | + foreach ($existingShares as $existingShare) { |
|
| 447 | 447 | try { |
| 448 | 448 | if ($existingShare->getFullId() === $share->getFullId()) { |
| 449 | 449 | continue; |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | // Make sure that we do not share a path that contains a shared mountpoint |
| 513 | 513 | if ($path instanceof \OCP\Files\Folder) { |
| 514 | 514 | $mounts = $this->mountManager->findIn($path->getPath()); |
| 515 | - foreach($mounts as $mount) { |
|
| 515 | + foreach ($mounts as $mount) { |
|
| 516 | 516 | if ($mount->getStorage()->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) { |
| 517 | 517 | throw new \InvalidArgumentException('Path contains files shared with you'); |
| 518 | 518 | } |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | $storage = $share->getNode()->getStorage(); |
| 561 | 561 | if ($storage->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
| 562 | 562 | $parent = $share->getNode()->getParent(); |
| 563 | - while($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
|
| 563 | + while ($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
|
| 564 | 564 | $parent = $parent->getParent(); |
| 565 | 565 | } |
| 566 | 566 | $share->setShareOwner($parent->getOwner()->getUID()); |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | // Generate the target |
| 620 | - $target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName(); |
|
| 620 | + $target = $this->config->getSystemValue('share_folder', '/').'/'.$share->getNode()->getName(); |
|
| 621 | 621 | $target = \OC\Files\Filesystem::normalizePath($target); |
| 622 | 622 | $share->setTarget($target); |
| 623 | 623 | |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | * @param string $recipientId |
| 865 | 865 | */ |
| 866 | 866 | public function deleteFromSelf(\OCP\Share\IShare $share, $recipientId) { |
| 867 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
| 867 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
| 868 | 868 | $provider = $this->factory->getProvider($providerId); |
| 869 | 869 | |
| 870 | 870 | $provider->deleteFromSelf($share, $recipientId); |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) { |
| 886 | 886 | $sharedWith = $this->groupManager->get($share->getSharedWith()); |
| 887 | 887 | if (is_null($sharedWith)) { |
| 888 | - throw new \InvalidArgumentException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
| 888 | + throw new \InvalidArgumentException('Group "'.$share->getSharedWith().'" does not exist'); |
|
| 889 | 889 | } |
| 890 | 890 | $recipient = $this->userManager->get($recipientId); |
| 891 | 891 | if (!$sharedWith->inGroup($recipient)) { |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | } |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | - list($providerId, ) = $this->splitFullId($share->getFullId()); |
|
| 896 | + list($providerId,) = $this->splitFullId($share->getFullId()); |
|
| 897 | 897 | $provider = $this->factory->getProvider($providerId); |
| 898 | 898 | |
| 899 | 899 | $provider->move($share, $recipientId); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | |
| 941 | 941 | $shares2 = []; |
| 942 | 942 | |
| 943 | - while(true) { |
|
| 943 | + while (true) { |
|
| 944 | 944 | $added = 0; |
| 945 | 945 | foreach ($shares as $share) { |
| 946 | 946 | |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | * |
| 1041 | 1041 | * @return Share[] |
| 1042 | 1042 | */ |
| 1043 | - public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) { |
|
| 1043 | + public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50) { |
|
| 1044 | 1044 | return []; |
| 1045 | 1045 | } |
| 1046 | 1046 | |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | public function getShareByToken($token) { |
| 1056 | 1056 | $share = null; |
| 1057 | 1057 | try { |
| 1058 | - if($this->shareApiAllowLinks()) { |
|
| 1058 | + if ($this->shareApiAllowLinks()) { |
|
| 1059 | 1059 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK); |
| 1060 | 1060 | $share = $provider->getShareByToken($token); |
| 1061 | 1061 | } |
@@ -1245,10 +1245,10 @@ discard block |
||
| 1245 | 1245 | |
| 1246 | 1246 | if ($currentAccess) { |
| 1247 | 1247 | $ownerPath = $path->getPath(); |
| 1248 | - list(, , , $ownerPath) = explode('/', $ownerPath, 4); |
|
| 1248 | + list(,,, $ownerPath) = explode('/', $ownerPath, 4); |
|
| 1249 | 1249 | $al['users'][$owner] = [ |
| 1250 | 1250 | 'node_id' => $path->getId(), |
| 1251 | - 'node_path' => '/' . $ownerPath, |
|
| 1251 | + 'node_path' => '/'.$ownerPath, |
|
| 1252 | 1252 | ]; |
| 1253 | 1253 | } else { |
| 1254 | 1254 | $al['users'][] = $owner; |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | * @return int |
| 1343 | 1343 | */ |
| 1344 | 1344 | public function shareApiLinkDefaultExpireDays() { |
| 1345 | - return (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 1345 | + return (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | 1348 | /** |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | ->orderBy('id'); |
| 289 | 289 | |
| 290 | 290 | $cursor = $qb->execute(); |
| 291 | - while($data = $cursor->fetch()) { |
|
| 291 | + while ($data = $cursor->fetch()) { |
|
| 292 | 292 | $children[] = $this->createShare($data); |
| 293 | 293 | } |
| 294 | 294 | $cursor->closeCursor(); |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $user = $this->userManager->get($recipient); |
| 334 | 334 | |
| 335 | 335 | if (is_null($group)) { |
| 336 | - throw new ProviderException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
| 336 | + throw new ProviderException('Group "'.$share->getSharedWith().'" does not exist'); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if (!$group->inGroup($user)) { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | ); |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 496 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 497 | 497 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 498 | 498 | |
| 499 | 499 | $qb->orderBy('id'); |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | |
| 550 | 550 | $cursor = $qb->execute(); |
| 551 | 551 | $shares = []; |
| 552 | - while($data = $cursor->fetch()) { |
|
| 552 | + while ($data = $cursor->fetch()) { |
|
| 553 | 553 | $shares[] = $this->createShare($data); |
| 554 | 554 | } |
| 555 | 555 | $cursor->closeCursor(); |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | ->execute(); |
| 629 | 629 | |
| 630 | 630 | $shares = []; |
| 631 | - while($data = $cursor->fetch()) { |
|
| 631 | + while ($data = $cursor->fetch()) { |
|
| 632 | 632 | $shares[] = $this->createShare($data); |
| 633 | 633 | } |
| 634 | 634 | $cursor->closeCursor(); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | |
| 700 | 700 | $cursor = $qb->execute(); |
| 701 | 701 | |
| 702 | - while($data = $cursor->fetch()) { |
|
| 702 | + while ($data = $cursor->fetch()) { |
|
| 703 | 703 | if ($this->isAccessibleResult($data)) { |
| 704 | 704 | $shares[] = $this->createShare($data); |
| 705 | 705 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | $shares2 = []; |
| 715 | 715 | |
| 716 | 716 | $start = 0; |
| 717 | - while(true) { |
|
| 717 | + while (true) { |
|
| 718 | 718 | $groups = array_slice($allGroups, $start, 100); |
| 719 | 719 | $start += 100; |
| 720 | 720 | |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | )); |
| 758 | 758 | |
| 759 | 759 | $cursor = $qb->execute(); |
| 760 | - while($data = $cursor->fetch()) { |
|
| 760 | + while ($data = $cursor->fetch()) { |
|
| 761 | 761 | if ($offset > 0) { |
| 762 | 762 | $offset--; |
| 763 | 763 | continue; |
@@ -826,14 +826,14 @@ discard block |
||
| 826 | 826 | */ |
| 827 | 827 | private function createShare($data) { |
| 828 | 828 | $share = new Share($this->rootFolder, $this->userManager); |
| 829 | - $share->setId((int)$data['id']) |
|
| 830 | - ->setShareType((int)$data['share_type']) |
|
| 831 | - ->setPermissions((int)$data['permissions']) |
|
| 829 | + $share->setId((int) $data['id']) |
|
| 830 | + ->setShareType((int) $data['share_type']) |
|
| 831 | + ->setPermissions((int) $data['permissions']) |
|
| 832 | 832 | ->setTarget($data['file_target']) |
| 833 | - ->setMailSend((bool)$data['mail_send']); |
|
| 833 | + ->setMailSend((bool) $data['mail_send']); |
|
| 834 | 834 | |
| 835 | 835 | $shareTime = new \DateTime(); |
| 836 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 836 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 837 | 837 | $share->setShareTime($shareTime); |
| 838 | 838 | |
| 839 | 839 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) { |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $share->setSharedBy($data['uid_initiator']); |
| 849 | 849 | $share->setShareOwner($data['uid_owner']); |
| 850 | 850 | |
| 851 | - $share->setNodeId((int)$data['file_source']); |
|
| 851 | + $share->setNodeId((int) $data['file_source']); |
|
| 852 | 852 | $share->setNodeType($data['item_type']); |
| 853 | 853 | |
| 854 | 854 | if ($data['expiration'] !== null) { |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | if (isset($data['f_permissions'])) { |
| 860 | 860 | $entryData = $data; |
| 861 | 861 | $entryData['permissions'] = $entryData['f_permissions']; |
| 862 | - $entryData['parent'] = $entryData['f_parent'];; |
|
| 862 | + $entryData['parent'] = $entryData['f_parent']; ; |
|
| 863 | 863 | $share->setNodeCacheEntry(Cache::cacheEntryFromData($entryData, |
| 864 | 864 | \OC::$server->getMimeTypeLoader())); |
| 865 | 865 | } |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | $result = []; |
| 879 | 879 | |
| 880 | 880 | $start = 0; |
| 881 | - while(true) { |
|
| 881 | + while (true) { |
|
| 882 | 882 | /** @var Share[] $shareSlice */ |
| 883 | 883 | $shareSlice = array_slice($shares, $start, 100); |
| 884 | 884 | $start += 100; |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | $shareMap = []; |
| 894 | 894 | |
| 895 | 895 | foreach ($shareSlice as $share) { |
| 896 | - $ids[] = (int)$share->getId(); |
|
| 896 | + $ids[] = (int) $share->getId(); |
|
| 897 | 897 | $shareMap[$share->getId()] = $share; |
| 898 | 898 | } |
| 899 | 899 | |
@@ -910,8 +910,8 @@ discard block |
||
| 910 | 910 | |
| 911 | 911 | $stmt = $query->execute(); |
| 912 | 912 | |
| 913 | - while($data = $stmt->fetch()) { |
|
| 914 | - $shareMap[$data['parent']]->setPermissions((int)$data['permissions']); |
|
| 913 | + while ($data = $stmt->fetch()) { |
|
| 914 | + $shareMap[$data['parent']]->setPermissions((int) $data['permissions']); |
|
| 915 | 915 | $shareMap[$data['parent']]->setTarget($data['file_target']); |
| 916 | 916 | } |
| 917 | 917 | |
@@ -1008,8 +1008,8 @@ discard block |
||
| 1008 | 1008 | |
| 1009 | 1009 | $cursor = $qb->execute(); |
| 1010 | 1010 | $ids = []; |
| 1011 | - while($row = $cursor->fetch()) { |
|
| 1012 | - $ids[] = (int)$row['id']; |
|
| 1011 | + while ($row = $cursor->fetch()) { |
|
| 1012 | + $ids[] = (int) $row['id']; |
|
| 1013 | 1013 | } |
| 1014 | 1014 | $cursor->closeCursor(); |
| 1015 | 1015 | |
@@ -1051,8 +1051,8 @@ discard block |
||
| 1051 | 1051 | |
| 1052 | 1052 | $cursor = $qb->execute(); |
| 1053 | 1053 | $ids = []; |
| 1054 | - while($row = $cursor->fetch()) { |
|
| 1055 | - $ids[] = (int)$row['id']; |
|
| 1054 | + while ($row = $cursor->fetch()) { |
|
| 1055 | + $ids[] = (int) $row['id']; |
|
| 1056 | 1056 | } |
| 1057 | 1057 | $cursor->closeCursor(); |
| 1058 | 1058 | |
@@ -1106,8 +1106,8 @@ discard block |
||
| 1106 | 1106 | |
| 1107 | 1107 | $users = []; |
| 1108 | 1108 | $link = false; |
| 1109 | - while($row = $cursor->fetch()) { |
|
| 1110 | - $type = (int)$row['share_type']; |
|
| 1109 | + while ($row = $cursor->fetch()) { |
|
| 1110 | + $type = (int) $row['share_type']; |
|
| 1111 | 1111 | if ($type === \OCP\Share::SHARE_TYPE_USER) { |
| 1112 | 1112 | $uid = $row['share_with']; |
| 1113 | 1113 | $users[$uid] = isset($users[$uid]) ? $users[$uid] : []; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $item = $node; |
| 117 | - $appendix = '/' . $node->getName(); |
|
| 117 | + $appendix = '/'.$node->getName(); |
|
| 118 | 118 | while (!empty($byId)) { |
| 119 | 119 | try { |
| 120 | 120 | /** @var Node $item */ |
@@ -122,12 +122,12 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | if (!empty($byId[$item->getId()])) { |
| 124 | 124 | foreach ($byId[$item->getId()] as $uid => $path) { |
| 125 | - $results[$uid] = $path . $appendix; |
|
| 125 | + $results[$uid] = $path.$appendix; |
|
| 126 | 126 | } |
| 127 | 127 | unset($byId[$item->getId()]); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $appendix = '/' . $item->getName() . $appendix; |
|
| 130 | + $appendix = '/'.$item->getName().$appendix; |
|
| 131 | 131 | } catch (NotFoundException $e) { |
| 132 | 132 | return $results; |
| 133 | 133 | } catch (InvalidPathException $e) { |
@@ -212,6 +212,6 @@ discard block |
||
| 212 | 212 | protected function getMountedPath(Node $node) { |
| 213 | 213 | $path = $node->getPath(); |
| 214 | 214 | $sections = explode('/', $path, 4); |
| 215 | - return '/' . $sections[3]; |
|
| 215 | + return '/'.$sections[3]; |
|
| 216 | 216 | } |
| 217 | 217 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class); |
| 134 | 134 | $this->registerAlias('ContactsManager', \OCP\Contacts\IManager::class); |
| 135 | 135 | |
| 136 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
| 136 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
| 137 | 137 | return new PreviewManager( |
| 138 | 138 | $c->getConfig(), |
| 139 | 139 | $c->getRootFolder(), |
@@ -144,13 +144,13 @@ discard block |
||
| 144 | 144 | }); |
| 145 | 145 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
| 146 | 146 | |
| 147 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
| 147 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
| 148 | 148 | return new \OC\Preview\Watcher( |
| 149 | 149 | $c->getAppDataDir('preview') |
| 150 | 150 | ); |
| 151 | 151 | }); |
| 152 | 152 | |
| 153 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
| 153 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
| 154 | 154 | $view = new View(); |
| 155 | 155 | $util = new Encryption\Util( |
| 156 | 156 | $view, |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ); |
| 169 | 169 | }); |
| 170 | 170 | |
| 171 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
| 171 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
| 172 | 172 | $util = new Encryption\Util( |
| 173 | 173 | new View(), |
| 174 | 174 | $c->getUserManager(), |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | ); |
| 183 | 183 | }); |
| 184 | 184 | |
| 185 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
| 185 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
| 186 | 186 | $view = new View(); |
| 187 | 187 | $util = new Encryption\Util( |
| 188 | 188 | $view, |
@@ -193,32 +193,32 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | return new Encryption\Keys\Storage($view, $util); |
| 195 | 195 | }); |
| 196 | - $this->registerService('TagMapper', function (Server $c) { |
|
| 196 | + $this->registerService('TagMapper', function(Server $c) { |
|
| 197 | 197 | return new TagMapper($c->getDatabaseConnection()); |
| 198 | 198 | }); |
| 199 | 199 | |
| 200 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
| 200 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
| 201 | 201 | $tagMapper = $c->query('TagMapper'); |
| 202 | 202 | return new TagManager($tagMapper, $c->getUserSession()); |
| 203 | 203 | }); |
| 204 | 204 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
| 205 | 205 | |
| 206 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
| 206 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
| 207 | 207 | $config = $c->getConfig(); |
| 208 | 208 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
| 209 | 209 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
| 210 | 210 | $factory = new $factoryClass($this); |
| 211 | 211 | return $factory; |
| 212 | 212 | }); |
| 213 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
| 213 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
| 214 | 214 | return $c->query('SystemTagManagerFactory')->getManager(); |
| 215 | 215 | }); |
| 216 | 216 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
| 217 | 217 | |
| 218 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
| 218 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
| 219 | 219 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
| 220 | 220 | }); |
| 221 | - $this->registerService('RootFolder', function (Server $c) { |
|
| 221 | + $this->registerService('RootFolder', function(Server $c) { |
|
| 222 | 222 | $manager = \OC\Files\Filesystem::getMountManager(null); |
| 223 | 223 | $view = new View(); |
| 224 | 224 | $root = new Root( |
@@ -246,30 +246,30 @@ discard block |
||
| 246 | 246 | }); |
| 247 | 247 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
| 248 | 248 | |
| 249 | - $this->registerService(\OCP\IUserManager::class, function (Server $c) { |
|
| 249 | + $this->registerService(\OCP\IUserManager::class, function(Server $c) { |
|
| 250 | 250 | $config = $c->getConfig(); |
| 251 | 251 | return new \OC\User\Manager($config); |
| 252 | 252 | }); |
| 253 | 253 | $this->registerAlias('UserManager', \OCP\IUserManager::class); |
| 254 | 254 | |
| 255 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
| 255 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
| 256 | 256 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
| 257 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
| 257 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
| 258 | 258 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
| 259 | 259 | }); |
| 260 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
| 260 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
| 261 | 261 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
| 262 | 262 | }); |
| 263 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
| 263 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
| 264 | 264 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
| 265 | 265 | }); |
| 266 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
| 266 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
| 267 | 267 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
| 268 | 268 | }); |
| 269 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 269 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 270 | 270 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 271 | 271 | }); |
| 272 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 272 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 273 | 273 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 274 | 274 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
| 275 | 275 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -289,11 +289,11 @@ discard block |
||
| 289 | 289 | return new Store($session, $logger, $tokenProvider); |
| 290 | 290 | }); |
| 291 | 291 | $this->registerAlias(IStore::class, Store::class); |
| 292 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
| 292 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
| 293 | 293 | $dbConnection = $c->getDatabaseConnection(); |
| 294 | 294 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
| 295 | 295 | }); |
| 296 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
| 296 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
| 297 | 297 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
| 298 | 298 | $crypto = $c->getCrypto(); |
| 299 | 299 | $config = $c->getConfig(); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | }); |
| 304 | 304 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
| 305 | 305 | |
| 306 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
| 306 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
| 307 | 307 | $manager = $c->getUserManager(); |
| 308 | 308 | $session = new \OC\Session\Memory(''); |
| 309 | 309 | $timeFactory = new TimeFactory(); |
@@ -316,40 +316,40 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom(), $c->getLockdownManager()); |
| 319 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
| 319 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
| 320 | 320 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 321 | 321 | }); |
| 322 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
| 322 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
| 323 | 323 | /** @var $user \OC\User\User */ |
| 324 | 324 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
| 325 | 325 | }); |
| 326 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
| 326 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
| 327 | 327 | /** @var $user \OC\User\User */ |
| 328 | 328 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
| 329 | 329 | }); |
| 330 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
| 330 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
| 331 | 331 | /** @var $user \OC\User\User */ |
| 332 | 332 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
| 333 | 333 | }); |
| 334 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 334 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
| 335 | 335 | /** @var $user \OC\User\User */ |
| 336 | 336 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 337 | 337 | }); |
| 338 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 338 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
| 339 | 339 | /** @var $user \OC\User\User */ |
| 340 | 340 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 341 | 341 | }); |
| 342 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
| 342 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
| 343 | 343 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 344 | 344 | }); |
| 345 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
| 345 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
| 346 | 346 | /** @var $user \OC\User\User */ |
| 347 | 347 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 348 | 348 | }); |
| 349 | - $userSession->listen('\OC\User', 'logout', function () { |
|
| 349 | + $userSession->listen('\OC\User', 'logout', function() { |
|
| 350 | 350 | \OC_Hook::emit('OC_User', 'logout', array()); |
| 351 | 351 | }); |
| 352 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
| 352 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
| 353 | 353 | /** @var $user \OC\User\User */ |
| 354 | 354 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
| 355 | 355 | }); |
@@ -357,14 +357,14 @@ discard block |
||
| 357 | 357 | }); |
| 358 | 358 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
| 359 | 359 | |
| 360 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
| 360 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
| 361 | 361 | return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger()); |
| 362 | 362 | }); |
| 363 | 363 | |
| 364 | 364 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
| 365 | 365 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
| 366 | 366 | |
| 367 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
| 367 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
| 368 | 368 | return new \OC\AllConfig( |
| 369 | 369 | $c->getSystemConfig() |
| 370 | 370 | ); |
@@ -372,17 +372,17 @@ discard block |
||
| 372 | 372 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
| 373 | 373 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
| 374 | 374 | |
| 375 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
| 375 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
| 376 | 376 | return new \OC\SystemConfig($config); |
| 377 | 377 | }); |
| 378 | 378 | |
| 379 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
| 379 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
| 380 | 380 | return new \OC\AppConfig($c->getDatabaseConnection()); |
| 381 | 381 | }); |
| 382 | 382 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
| 383 | 383 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
| 384 | 384 | |
| 385 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
| 385 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
| 386 | 386 | return new \OC\L10N\Factory( |
| 387 | 387 | $c->getConfig(), |
| 388 | 388 | $c->getRequest(), |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | }); |
| 393 | 393 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
| 394 | 394 | |
| 395 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
| 395 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
| 396 | 396 | $config = $c->getConfig(); |
| 397 | 397 | $cacheFactory = $c->getMemCacheFactory(); |
| 398 | 398 | return new \OC\URLGenerator( |
@@ -402,10 +402,10 @@ discard block |
||
| 402 | 402 | }); |
| 403 | 403 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
| 404 | 404 | |
| 405 | - $this->registerService('AppHelper', function ($c) { |
|
| 405 | + $this->registerService('AppHelper', function($c) { |
|
| 406 | 406 | return new \OC\AppHelper(); |
| 407 | 407 | }); |
| 408 | - $this->registerService('AppFetcher', function ($c) { |
|
| 408 | + $this->registerService('AppFetcher', function($c) { |
|
| 409 | 409 | return new AppFetcher( |
| 410 | 410 | $this->getAppDataDir('appstore'), |
| 411 | 411 | $this->getHTTPClientService(), |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $this->getConfig() |
| 414 | 414 | ); |
| 415 | 415 | }); |
| 416 | - $this->registerService('CategoryFetcher', function ($c) { |
|
| 416 | + $this->registerService('CategoryFetcher', function($c) { |
|
| 417 | 417 | return new CategoryFetcher( |
| 418 | 418 | $this->getAppDataDir('appstore'), |
| 419 | 419 | $this->getHTTPClientService(), |
@@ -422,21 +422,21 @@ discard block |
||
| 422 | 422 | ); |
| 423 | 423 | }); |
| 424 | 424 | |
| 425 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
| 425 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
| 426 | 426 | return new Cache\File(); |
| 427 | 427 | }); |
| 428 | 428 | $this->registerAlias('UserCache', \OCP\ICache::class); |
| 429 | 429 | |
| 430 | - $this->registerService(Factory::class, function (Server $c) { |
|
| 430 | + $this->registerService(Factory::class, function(Server $c) { |
|
| 431 | 431 | $config = $c->getConfig(); |
| 432 | 432 | |
| 433 | 433 | if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
| 434 | 434 | $v = \OC_App::getAppVersions(); |
| 435 | - $v['core'] = md5(file_get_contents(\OC::$SERVERROOT . '/version.php')); |
|
| 435 | + $v['core'] = md5(file_get_contents(\OC::$SERVERROOT.'/version.php')); |
|
| 436 | 436 | $version = implode(',', $v); |
| 437 | 437 | $instanceId = \OC_Util::getInstanceId(); |
| 438 | 438 | $path = \OC::$SERVERROOT; |
| 439 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT); |
|
| 439 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.\OC::$WEBROOT); |
|
| 440 | 440 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 441 | 441 | $config->getSystemValue('memcache.local', null), |
| 442 | 442 | $config->getSystemValue('memcache.distributed', null), |
@@ -453,12 +453,12 @@ discard block |
||
| 453 | 453 | $this->registerAlias('MemCacheFactory', Factory::class); |
| 454 | 454 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 455 | 455 | |
| 456 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 456 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 457 | 457 | $systemConfig = $c->getSystemConfig(); |
| 458 | 458 | return new RedisFactory($systemConfig); |
| 459 | 459 | }); |
| 460 | 460 | |
| 461 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 461 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 462 | 462 | return new \OC\Activity\Manager( |
| 463 | 463 | $c->getRequest(), |
| 464 | 464 | $c->getUserSession(), |
@@ -468,14 +468,14 @@ discard block |
||
| 468 | 468 | }); |
| 469 | 469 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 470 | 470 | |
| 471 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 471 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 472 | 472 | return new \OC\Activity\EventMerger( |
| 473 | 473 | $c->getL10N('lib') |
| 474 | 474 | ); |
| 475 | 475 | }); |
| 476 | 476 | $this->registerAlias(IValidator::class, Validator::class); |
| 477 | 477 | |
| 478 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
| 478 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
| 479 | 479 | return new AvatarManager( |
| 480 | 480 | $c->getUserManager(), |
| 481 | 481 | $c->getAppDataDir('avatar'), |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | }); |
| 487 | 487 | $this->registerAlias('AvatarManager', \OCP\IAvatarManager::class); |
| 488 | 488 | |
| 489 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
| 489 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
| 490 | 490 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
| 491 | 491 | $logger = Log::getLogClass($logType); |
| 492 | 492 | call_user_func(array($logger, 'init')); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | }); |
| 496 | 496 | $this->registerAlias('Logger', \OCP\ILogger::class); |
| 497 | 497 | |
| 498 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
| 498 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
| 499 | 499 | $config = $c->getConfig(); |
| 500 | 500 | return new \OC\BackgroundJob\JobList( |
| 501 | 501 | $c->getDatabaseConnection(), |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | }); |
| 506 | 506 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
| 507 | 507 | |
| 508 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
| 508 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
| 509 | 509 | $cacheFactory = $c->getMemCacheFactory(); |
| 510 | 510 | $logger = $c->getLogger(); |
| 511 | 511 | if ($cacheFactory->isAvailable()) { |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | }); |
| 518 | 518 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
| 519 | 519 | |
| 520 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
| 520 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
| 521 | 521 | return new Search(); |
| 522 | 522 | }); |
| 523 | 523 | $this->registerAlias('Search', \OCP\ISearch::class); |
@@ -537,27 +537,27 @@ discard block |
||
| 537 | 537 | ); |
| 538 | 538 | }); |
| 539 | 539 | |
| 540 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 540 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 541 | 541 | return new SecureRandom(); |
| 542 | 542 | }); |
| 543 | 543 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 544 | 544 | |
| 545 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
| 545 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
| 546 | 546 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 547 | 547 | }); |
| 548 | 548 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
| 549 | 549 | |
| 550 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
| 550 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
| 551 | 551 | return new Hasher($c->getConfig()); |
| 552 | 552 | }); |
| 553 | 553 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
| 554 | 554 | |
| 555 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
| 555 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
| 556 | 556 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 557 | 557 | }); |
| 558 | 558 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
| 559 | 559 | |
| 560 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 560 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 561 | 561 | $systemConfig = $c->getSystemConfig(); |
| 562 | 562 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 563 | 563 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | }); |
| 572 | 572 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
| 573 | 573 | |
| 574 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
| 574 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
| 575 | 575 | $config = $c->getConfig(); |
| 576 | 576 | return new HTTPHelper( |
| 577 | 577 | $config, |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | ); |
| 580 | 580 | }); |
| 581 | 581 | |
| 582 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
| 582 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
| 583 | 583 | $user = \OC_User::getUser(); |
| 584 | 584 | $uid = $user ? $user : null; |
| 585 | 585 | return new ClientService( |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | }); |
| 590 | 590 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
| 591 | 591 | |
| 592 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
| 592 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
| 593 | 593 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 594 | 594 | return new EventLogger(); |
| 595 | 595 | } else { |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | }); |
| 599 | 599 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
| 600 | 600 | |
| 601 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
| 601 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
| 602 | 602 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 603 | 603 | return new QueryLogger(); |
| 604 | 604 | } else { |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | }); |
| 608 | 608 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
| 609 | 609 | |
| 610 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 610 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 611 | 611 | return new TempManager( |
| 612 | 612 | $c->getLogger(), |
| 613 | 613 | $c->getConfig() |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | $this->registerAlias('TempManager', TempManager::class); |
| 617 | 617 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 618 | 618 | |
| 619 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 619 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 620 | 620 | return new \OC\App\AppManager( |
| 621 | 621 | $c->getUserSession(), |
| 622 | 622 | $c->getAppConfig(), |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | $this->registerAlias('AppManager', AppManager::class); |
| 629 | 629 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 630 | 630 | |
| 631 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
| 631 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
| 632 | 632 | return new DateTimeZone( |
| 633 | 633 | $c->getConfig(), |
| 634 | 634 | $c->getSession() |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | }); |
| 637 | 637 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
| 638 | 638 | |
| 639 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
| 639 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
| 640 | 640 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 641 | 641 | |
| 642 | 642 | return new DateTimeFormatter( |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | }); |
| 647 | 647 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
| 648 | 648 | |
| 649 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
| 649 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
| 650 | 650 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 651 | 651 | $listener = new UserMountCacheListener($mountCache); |
| 652 | 652 | $listener->listen($c->getUserManager()); |
@@ -654,10 +654,10 @@ discard block |
||
| 654 | 654 | }); |
| 655 | 655 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
| 656 | 656 | |
| 657 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
| 657 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
| 658 | 658 | $loader = \OC\Files\Filesystem::getLoader(); |
| 659 | 659 | $mountCache = $c->query('UserMountCache'); |
| 660 | - $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
| 660 | + $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
| 661 | 661 | |
| 662 | 662 | // builtin providers |
| 663 | 663 | |
@@ -670,14 +670,14 @@ discard block |
||
| 670 | 670 | }); |
| 671 | 671 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
| 672 | 672 | |
| 673 | - $this->registerService('IniWrapper', function ($c) { |
|
| 673 | + $this->registerService('IniWrapper', function($c) { |
|
| 674 | 674 | return new IniGetWrapper(); |
| 675 | 675 | }); |
| 676 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 676 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 677 | 677 | $jobList = $c->getJobList(); |
| 678 | 678 | return new AsyncBus($jobList); |
| 679 | 679 | }); |
| 680 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 680 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 681 | 681 | return new TrustedDomainHelper($this->getConfig()); |
| 682 | 682 | }); |
| 683 | 683 | $this->registerService('Throttler', function(Server $c) { |
@@ -688,10 +688,10 @@ discard block |
||
| 688 | 688 | $c->getConfig() |
| 689 | 689 | ); |
| 690 | 690 | }); |
| 691 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 691 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 692 | 692 | // IConfig and IAppManager requires a working database. This code |
| 693 | 693 | // might however be called when ownCloud is not yet setup. |
| 694 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
| 694 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
| 695 | 695 | $config = $c->getConfig(); |
| 696 | 696 | $appManager = $c->getAppManager(); |
| 697 | 697 | } else { |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $c->getTempManager() |
| 710 | 710 | ); |
| 711 | 711 | }); |
| 712 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 712 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 713 | 713 | if (isset($this['urlParams'])) { |
| 714 | 714 | $urlParams = $this['urlParams']; |
| 715 | 715 | } else { |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | }); |
| 746 | 746 | $this->registerAlias('Request', \OCP\IRequest::class); |
| 747 | 747 | |
| 748 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
| 748 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
| 749 | 749 | return new Mailer( |
| 750 | 750 | $c->getConfig(), |
| 751 | 751 | $c->getLogger(), |
@@ -759,14 +759,14 @@ discard block |
||
| 759 | 759 | $this->registerService('LDAPProvider', function(Server $c) { |
| 760 | 760 | $config = $c->getConfig(); |
| 761 | 761 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
| 762 | - if(is_null($factoryClass)) { |
|
| 762 | + if (is_null($factoryClass)) { |
|
| 763 | 763 | throw new \Exception('ldapProviderFactory not set'); |
| 764 | 764 | } |
| 765 | 765 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
| 766 | 766 | $factory = new $factoryClass($this); |
| 767 | 767 | return $factory->getLDAPProvider(); |
| 768 | 768 | }); |
| 769 | - $this->registerService('LockingProvider', function (Server $c) { |
|
| 769 | + $this->registerService('LockingProvider', function(Server $c) { |
|
| 770 | 770 | $ini = $c->getIniWrapper(); |
| 771 | 771 | $config = $c->getConfig(); |
| 772 | 772 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -782,37 +782,37 @@ discard block |
||
| 782 | 782 | return new NoopLockingProvider(); |
| 783 | 783 | }); |
| 784 | 784 | |
| 785 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
| 785 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
| 786 | 786 | return new \OC\Files\Mount\Manager(); |
| 787 | 787 | }); |
| 788 | 788 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
| 789 | 789 | |
| 790 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
| 790 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
| 791 | 791 | return new \OC\Files\Type\Detection( |
| 792 | 792 | $c->getURLGenerator(), |
| 793 | 793 | \OC::$configDir, |
| 794 | - \OC::$SERVERROOT . '/resources/config/' |
|
| 794 | + \OC::$SERVERROOT.'/resources/config/' |
|
| 795 | 795 | ); |
| 796 | 796 | }); |
| 797 | 797 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
| 798 | 798 | |
| 799 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
| 799 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
| 800 | 800 | return new \OC\Files\Type\Loader( |
| 801 | 801 | $c->getDatabaseConnection() |
| 802 | 802 | ); |
| 803 | 803 | }); |
| 804 | 804 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
| 805 | 805 | |
| 806 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
| 806 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
| 807 | 807 | return new Manager( |
| 808 | 808 | $c->query(IValidator::class) |
| 809 | 809 | ); |
| 810 | 810 | }); |
| 811 | 811 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
| 812 | 812 | |
| 813 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
| 813 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
| 814 | 814 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
| 815 | - $manager->registerCapability(function () use ($c) { |
|
| 815 | + $manager->registerCapability(function() use ($c) { |
|
| 816 | 816 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
| 817 | 817 | }); |
| 818 | 818 | return $manager; |
@@ -854,13 +854,13 @@ discard block |
||
| 854 | 854 | } |
| 855 | 855 | return new \OC_Defaults(); |
| 856 | 856 | }); |
| 857 | - $this->registerService(EventDispatcher::class, function () { |
|
| 857 | + $this->registerService(EventDispatcher::class, function() { |
|
| 858 | 858 | return new EventDispatcher(); |
| 859 | 859 | }); |
| 860 | 860 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
| 861 | 861 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
| 862 | 862 | |
| 863 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
| 863 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
| 864 | 864 | // FIXME: Instantiiated here due to cyclic dependency |
| 865 | 865 | $request = new Request( |
| 866 | 866 | [ |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | $request |
| 886 | 886 | ); |
| 887 | 887 | }); |
| 888 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
| 888 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
| 889 | 889 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
| 890 | 890 | |
| 891 | 891 | return new CsrfTokenManager( |
@@ -893,10 +893,10 @@ discard block |
||
| 893 | 893 | $c->query(SessionStorage::class) |
| 894 | 894 | ); |
| 895 | 895 | }); |
| 896 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
| 896 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
| 897 | 897 | return new SessionStorage($c->getSession()); |
| 898 | 898 | }); |
| 899 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
| 899 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
| 900 | 900 | return new ContentSecurityPolicyManager(); |
| 901 | 901 | }); |
| 902 | 902 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
@@ -947,29 +947,29 @@ discard block |
||
| 947 | 947 | ); |
| 948 | 948 | return $manager; |
| 949 | 949 | }); |
| 950 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
| 950 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
| 951 | 951 | return new \OC\Files\AppData\Factory( |
| 952 | 952 | $c->getRootFolder(), |
| 953 | 953 | $c->getSystemConfig() |
| 954 | 954 | ); |
| 955 | 955 | }); |
| 956 | 956 | |
| 957 | - $this->registerService('LockdownManager', function (Server $c) { |
|
| 957 | + $this->registerService('LockdownManager', function(Server $c) { |
|
| 958 | 958 | return new LockdownManager(function() use ($c) { |
| 959 | 959 | return $c->getSession(); |
| 960 | 960 | }); |
| 961 | 961 | }); |
| 962 | 962 | |
| 963 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
| 963 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
| 964 | 964 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
| 965 | 965 | }); |
| 966 | 966 | |
| 967 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
| 967 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
| 968 | 968 | return new CloudIdManager(); |
| 969 | 969 | }); |
| 970 | 970 | |
| 971 | 971 | /* To trick DI since we don't extend the DIContainer here */ |
| 972 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
| 972 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
| 973 | 973 | return new CleanPreviewsBackgroundJob( |
| 974 | 974 | $c->getRootFolder(), |
| 975 | 975 | $c->getLogger(), |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
| 985 | 985 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
| 986 | 986 | |
| 987 | - $this->registerService(Defaults::class, function (Server $c) { |
|
| 987 | + $this->registerService(Defaults::class, function(Server $c) { |
|
| 988 | 988 | return new Defaults( |
| 989 | 989 | $c->getThemingDefaults() |
| 990 | 990 | ); |
@@ -1136,7 +1136,7 @@ discard block |
||
| 1136 | 1136 | * @deprecated since 9.2.0 use IAppData |
| 1137 | 1137 | */ |
| 1138 | 1138 | public function getAppFolder() { |
| 1139 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
| 1139 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
| 1140 | 1140 | $root = $this->getRootFolder(); |
| 1141 | 1141 | if (!$root->nodeExists($dir)) { |
| 1142 | 1142 | $folder = $root->newFolder($dir); |