@@ -103,6 +103,6 @@ |
||
103 | 103 | $time = new \DateTime('now', $timeZone); |
104 | 104 | $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', 'c')); |
105 | 105 | |
106 | - return $timestampInfo . ' ' . $this->formatter->format($message); |
|
106 | + return $timestampInfo.' '.$this->formatter->format($message); |
|
107 | 107 | } |
108 | 108 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | if ($fullId === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) { |
282 | 282 | $expirationDate = new \DateTime(); |
283 | - $expirationDate->setTime(0,0,0); |
|
283 | + $expirationDate->setTime(0, 0, 0); |
|
284 | 284 | $expirationDate->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
285 | 285 | } |
286 | 286 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | $date = new \DateTime(); |
294 | 294 | $date->setTime(0, 0, 0); |
295 | - $date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D')); |
|
295 | + $date->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D')); |
|
296 | 296 | if ($date < $expirationDate) { |
297 | 297 | $message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]); |
298 | 298 | throw new GenericShareException($message, $message, 404); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | */ |
346 | 346 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_USER); |
347 | 347 | $existingShares = $provider->getSharesByPath($share->getNode()); |
348 | - foreach($existingShares as $existingShare) { |
|
348 | + foreach ($existingShares as $existingShare) { |
|
349 | 349 | // Ignore if it is the same share |
350 | 350 | try { |
351 | 351 | if ($existingShare->getFullId() === $share->getFullId()) { |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | */ |
401 | 401 | $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_GROUP); |
402 | 402 | $existingShares = $provider->getSharesByPath($share->getNode()); |
403 | - foreach($existingShares as $existingShare) { |
|
403 | + foreach ($existingShares as $existingShare) { |
|
404 | 404 | try { |
405 | 405 | if ($existingShare->getFullId() === $share->getFullId()) { |
406 | 406 | continue; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | // Make sure that we do not share a path that contains a shared mountpoint |
474 | 474 | if ($path instanceof \OCP\Files\Folder) { |
475 | 475 | $mounts = $this->mountManager->findIn($path->getPath()); |
476 | - foreach($mounts as $mount) { |
|
476 | + foreach ($mounts as $mount) { |
|
477 | 477 | if ($mount->getStorage()->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) { |
478 | 478 | throw new \InvalidArgumentException('Path contains files shared with you'); |
479 | 479 | } |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $storage = $share->getNode()->getStorage(); |
522 | 522 | if ($storage->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
523 | 523 | $parent = $share->getNode()->getParent(); |
524 | - while($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
|
524 | + while ($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) { |
|
525 | 525 | $parent = $parent->getParent(); |
526 | 526 | } |
527 | 527 | $share->setShareOwner($parent->getOwner()->getUID()); |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | } |
570 | 570 | |
571 | 571 | // Generate the target |
572 | - $target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName(); |
|
572 | + $target = $this->config->getSystemValue('share_folder', '/').'/'.$share->getNode()->getName(); |
|
573 | 573 | $target = \OC\Files\Filesystem::normalizePath($target); |
574 | 574 | $share->setTarget($target); |
575 | 575 | |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | * @param string $recipientId |
825 | 825 | */ |
826 | 826 | public function deleteFromSelf(\OCP\Share\IShare $share, $recipientId) { |
827 | - list($providerId, ) = $this->splitFullId($share->getId()); |
|
827 | + list($providerId,) = $this->splitFullId($share->getId()); |
|
828 | 828 | $provider = $this->factory->getProvider($providerId); |
829 | 829 | |
830 | 830 | $provider->deleteFromSelf($share, $recipientId); |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | } |
851 | 851 | } |
852 | 852 | |
853 | - list($providerId, ) = $this->splitFullId($share->getId()); |
|
853 | + list($providerId,) = $this->splitFullId($share->getId()); |
|
854 | 854 | $provider = $this->factory->getProvider($providerId); |
855 | 855 | |
856 | 856 | $provider->move($share, $recipientId); |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | $shares2 = []; |
887 | 887 | $today = new \DateTime(); |
888 | 888 | |
889 | - while(true) { |
|
889 | + while (true) { |
|
890 | 890 | $added = 0; |
891 | 891 | foreach ($shares as $share) { |
892 | 892 | // Check if the share is expired and if so delete it |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | * |
977 | 977 | * @return Share[] |
978 | 978 | */ |
979 | - public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) { |
|
979 | + public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50) { |
|
980 | 980 | } |
981 | 981 | |
982 | 982 | /** |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | * @return int |
1130 | 1130 | */ |
1131 | 1131 | public function shareApiLinkDefaultExpireDays() { |
1132 | - return (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1132 | + return (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | /** |
@@ -94,7 +94,7 @@ |
||
94 | 94 | if ($this->providerId === null || $this->id === null) { |
95 | 95 | throw new \UnexpectedValueException; |
96 | 96 | } |
97 | - return $this->providerId . ':' . $this->id; |
|
97 | + return $this->providerId.':'.$this->id; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($provider === null) { |
136 | - throw new ProviderException('No provider with id .' . $id . ' found.'); |
|
136 | + throw new ProviderException('No provider with id .'.$id.' found.'); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $provider; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $provider = null; |
147 | 147 | |
148 | 148 | //FIXME we should not report type 2 |
149 | - if ($shareType === \OCP\Share::SHARE_TYPE_USER || |
|
149 | + if ($shareType === \OCP\Share::SHARE_TYPE_USER || |
|
150 | 150 | $shareType === 2 || |
151 | 151 | $shareType === \OCP\Share::SHARE_TYPE_GROUP || |
152 | 152 | $shareType === \OCP\Share::SHARE_TYPE_LINK) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | if ($provider === null) { |
159 | - throw new ProviderException('No share provider for share type ' . $shareType); |
|
159 | + throw new ProviderException('No share provider for share type '.$shareType); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | return $provider; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | ->orderBy('id'); |
283 | 283 | |
284 | 284 | $cursor = $qb->execute(); |
285 | - while($data = $cursor->fetch()) { |
|
285 | + while ($data = $cursor->fetch()) { |
|
286 | 286 | $children[] = $this->createShare($data); |
287 | 287 | } |
288 | 288 | $cursor->closeCursor(); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | |
515 | 515 | $cursor = $qb->execute(); |
516 | 516 | $shares = []; |
517 | - while($data = $cursor->fetch()) { |
|
517 | + while ($data = $cursor->fetch()) { |
|
518 | 518 | $shares[] = $this->createShare($data); |
519 | 519 | } |
520 | 520 | $cursor->closeCursor(); |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | ->execute(); |
594 | 594 | |
595 | 595 | $shares = []; |
596 | - while($data = $cursor->fetch()) { |
|
596 | + while ($data = $cursor->fetch()) { |
|
597 | 597 | $shares[] = $this->createShare($data); |
598 | 598 | } |
599 | 599 | $cursor->closeCursor(); |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | |
638 | 638 | $cursor = $qb->execute(); |
639 | 639 | |
640 | - while($data = $cursor->fetch()) { |
|
640 | + while ($data = $cursor->fetch()) { |
|
641 | 641 | $shares[] = $this->createShare($data); |
642 | 642 | } |
643 | 643 | $cursor->closeCursor(); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | $shares2 = []; |
651 | 651 | |
652 | 652 | $start = 0; |
653 | - while(true) { |
|
653 | + while (true) { |
|
654 | 654 | $groups = array_slice($allGroups, $start, 100); |
655 | 655 | $start += 100; |
656 | 656 | |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | )); |
687 | 687 | |
688 | 688 | $cursor = $qb->execute(); |
689 | - while($data = $cursor->fetch()) { |
|
689 | + while ($data = $cursor->fetch()) { |
|
690 | 690 | if ($offset > 0) { |
691 | 691 | $offset--; |
692 | 692 | continue; |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | * Resolve all group shares to user specific shares |
701 | 701 | * TODO: Optmize this! |
702 | 702 | */ |
703 | - foreach($shares2 as $share) { |
|
703 | + foreach ($shares2 as $share) { |
|
704 | 704 | $shares[] = $this->resolveGroupShare($share, $userId); |
705 | 705 | } |
706 | 706 | } else { |
@@ -755,14 +755,14 @@ discard block |
||
755 | 755 | */ |
756 | 756 | private function createShare($data) { |
757 | 757 | $share = new Share($this->rootFolder); |
758 | - $share->setId((int)$data['id']) |
|
759 | - ->setShareType((int)$data['share_type']) |
|
760 | - ->setPermissions((int)$data['permissions']) |
|
758 | + $share->setId((int) $data['id']) |
|
759 | + ->setShareType((int) $data['share_type']) |
|
760 | + ->setPermissions((int) $data['permissions']) |
|
761 | 761 | ->setTarget($data['file_target']) |
762 | - ->setMailSend((bool)$data['mail_send']); |
|
762 | + ->setMailSend((bool) $data['mail_send']); |
|
763 | 763 | |
764 | 764 | $shareTime = new \DateTime(); |
765 | - $shareTime->setTimestamp((int)$data['stime']); |
|
765 | + $shareTime->setTimestamp((int) $data['stime']); |
|
766 | 766 | $share->setShareTime($shareTime); |
767 | 767 | |
768 | 768 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) { |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | if ($data['uid_initiator'] === null) { |
778 | 778 | //OLD SHARE |
779 | 779 | $share->setSharedBy($data['uid_owner']); |
780 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
780 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
781 | 781 | |
782 | 782 | $owner = $path->getOwner(); |
783 | 783 | $share->setShareOwner($owner->getUID()); |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | $share->setShareOwner($data['uid_owner']); |
788 | 788 | } |
789 | 789 | |
790 | - $share->setNodeId((int)$data['file_source']); |
|
790 | + $share->setNodeId((int) $data['file_source']); |
|
791 | 791 | $share->setNodeType($data['item_type']); |
792 | 792 | |
793 | 793 | if ($data['expiration'] !== null) { |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | $stmt->closeCursor(); |
852 | 852 | |
853 | 853 | if ($data !== false) { |
854 | - $share->setPermissions((int)$data['permissions']); |
|
854 | + $share->setPermissions((int) $data['permissions']); |
|
855 | 855 | $share->setTarget($data['file_target']); |
856 | 856 | } |
857 | 857 |
@@ -91,40 +91,40 @@ discard block |
||
91 | 91 | * |
92 | 92 | * Returns a url to the given app and file. |
93 | 93 | */ |
94 | - public function linkTo( $app, $file, $args = array() ) { |
|
94 | + public function linkTo($app, $file, $args = array()) { |
|
95 | 95 | $frontControllerActive = (getenv('front_controller_active') === 'true'); |
96 | 96 | |
97 | - if( $app != '' ) { |
|
97 | + if ($app != '') { |
|
98 | 98 | $app_path = \OC_App::getAppPath($app); |
99 | 99 | // Check if the app is in the app folder |
100 | - if ($app_path && file_exists($app_path . '/' . $file)) { |
|
100 | + if ($app_path && file_exists($app_path.'/'.$file)) { |
|
101 | 101 | if (substr($file, -3) == 'php') { |
102 | 102 | |
103 | - $urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $app; |
|
103 | + $urlLinkTo = \OC::$WEBROOT.'/index.php/apps/'.$app; |
|
104 | 104 | if ($frontControllerActive) { |
105 | - $urlLinkTo = \OC::$WEBROOT . '/apps/' . $app; |
|
105 | + $urlLinkTo = \OC::$WEBROOT.'/apps/'.$app; |
|
106 | 106 | } |
107 | - $urlLinkTo .= ($file != 'index.php') ? '/' . $file : ''; |
|
107 | + $urlLinkTo .= ($file != 'index.php') ? '/'.$file : ''; |
|
108 | 108 | } else { |
109 | - $urlLinkTo = \OC_App::getAppWebPath($app) . '/' . $file; |
|
109 | + $urlLinkTo = \OC_App::getAppWebPath($app).'/'.$file; |
|
110 | 110 | } |
111 | 111 | } else { |
112 | - $urlLinkTo = \OC::$WEBROOT . '/' . $app . '/' . $file; |
|
112 | + $urlLinkTo = \OC::$WEBROOT.'/'.$app.'/'.$file; |
|
113 | 113 | } |
114 | 114 | } else { |
115 | - if (file_exists(\OC::$SERVERROOT . '/core/' . $file)) { |
|
116 | - $urlLinkTo = \OC::$WEBROOT . '/core/' . $file; |
|
115 | + if (file_exists(\OC::$SERVERROOT.'/core/'.$file)) { |
|
116 | + $urlLinkTo = \OC::$WEBROOT.'/core/'.$file; |
|
117 | 117 | } else { |
118 | 118 | if ($frontControllerActive && $file === 'index.php') { |
119 | - $urlLinkTo = \OC::$WEBROOT . '/'; |
|
119 | + $urlLinkTo = \OC::$WEBROOT.'/'; |
|
120 | 120 | } else { |
121 | - $urlLinkTo = \OC::$WEBROOT . '/' . $file; |
|
121 | + $urlLinkTo = \OC::$WEBROOT.'/'.$file; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | 126 | if ($args && $query = http_build_query($args, '', '&')) { |
127 | - $urlLinkTo .= '?' . $query; |
|
127 | + $urlLinkTo .= '?'.$query; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | return $urlLinkTo; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | public function imagePath($app, $image) { |
143 | 143 | $cache = $this->cacheFactory->create('imagePath'); |
144 | 144 | $cacheKey = $app.'-'.$image; |
145 | - if($key = $cache->get($cacheKey)) { |
|
145 | + if ($key = $cache->get($cacheKey)) { |
|
146 | 146 | return $key; |
147 | 147 | } |
148 | 148 | |
@@ -150,46 +150,46 @@ discard block |
||
150 | 150 | $theme = \OC_Util::getTheme(); |
151 | 151 | |
152 | 152 | //if a theme has a png but not an svg always use the png |
153 | - $basename = substr(basename($image),0,-4); |
|
153 | + $basename = substr(basename($image), 0, -4); |
|
154 | 154 | |
155 | 155 | $appPath = \OC_App::getAppPath($app); |
156 | 156 | |
157 | 157 | // Check if the app is in the app folder |
158 | 158 | $path = ''; |
159 | - if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { |
|
160 | - $path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image"; |
|
161 | - } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.svg") |
|
162 | - && file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$basename.png")) { |
|
163 | - $path = \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$basename.png"; |
|
164 | - } elseif ($appPath && file_exists($appPath . "/img/$image")) { |
|
165 | - $path = \OC_App::getAppWebPath($app) . "/img/$image"; |
|
166 | - } elseif ($appPath && !file_exists($appPath . "/img/$basename.svg") |
|
167 | - && file_exists($appPath . "/img/$basename.png")) { |
|
168 | - $path = \OC_App::getAppWebPath($app) . "/img/$basename.png"; |
|
169 | - } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) { |
|
170 | - $path = \OC::$WEBROOT . "/themes/$theme/$app/img/$image"; |
|
171 | - } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$basename.svg") |
|
172 | - && file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$basename.png"))) { |
|
173 | - $path = \OC::$WEBROOT . "/themes/$theme/$app/img/$basename.png"; |
|
174 | - } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) { |
|
175 | - $path = \OC::$WEBROOT . "/$app/img/$image"; |
|
176 | - } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT . "/$app/img/$basename.svg") |
|
177 | - && file_exists(\OC::$SERVERROOT . "/$app/img/$basename.png"))) { |
|
178 | - $path = \OC::$WEBROOT . "/$app/img/$basename.png"; |
|
179 | - } elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$image")) { |
|
180 | - $path = \OC::$WEBROOT . "/themes/$theme/core/img/$image"; |
|
181 | - } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.svg") |
|
182 | - && file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.png")) { |
|
183 | - $path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png"; |
|
184 | - } elseif (file_exists(\OC::$SERVERROOT . "/core/img/$image")) { |
|
185 | - $path = \OC::$WEBROOT . "/core/img/$image"; |
|
159 | + if (file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$app/img/$image")) { |
|
160 | + $path = \OC::$WEBROOT."/themes/$theme/apps/$app/img/$image"; |
|
161 | + } elseif (!file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$app/img/$basename.svg") |
|
162 | + && file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$app/img/$basename.png")) { |
|
163 | + $path = \OC::$WEBROOT."/themes/$theme/apps/$app/img/$basename.png"; |
|
164 | + } elseif ($appPath && file_exists($appPath."/img/$image")) { |
|
165 | + $path = \OC_App::getAppWebPath($app)."/img/$image"; |
|
166 | + } elseif ($appPath && !file_exists($appPath."/img/$basename.svg") |
|
167 | + && file_exists($appPath."/img/$basename.png")) { |
|
168 | + $path = \OC_App::getAppWebPath($app)."/img/$basename.png"; |
|
169 | + } elseif (!empty($app) and file_exists(\OC::$SERVERROOT."/themes/$theme/$app/img/$image")) { |
|
170 | + $path = \OC::$WEBROOT."/themes/$theme/$app/img/$image"; |
|
171 | + } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT."/themes/$theme/$app/img/$basename.svg") |
|
172 | + && file_exists(\OC::$SERVERROOT."/themes/$theme/$app/img/$basename.png"))) { |
|
173 | + $path = \OC::$WEBROOT."/themes/$theme/$app/img/$basename.png"; |
|
174 | + } elseif (!empty($app) and file_exists(\OC::$SERVERROOT."/$app/img/$image")) { |
|
175 | + $path = \OC::$WEBROOT."/$app/img/$image"; |
|
176 | + } elseif (!empty($app) and (!file_exists(\OC::$SERVERROOT."/$app/img/$basename.svg") |
|
177 | + && file_exists(\OC::$SERVERROOT."/$app/img/$basename.png"))) { |
|
178 | + $path = \OC::$WEBROOT."/$app/img/$basename.png"; |
|
179 | + } elseif (file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$image")) { |
|
180 | + $path = \OC::$WEBROOT."/themes/$theme/core/img/$image"; |
|
181 | + } elseif (!file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$basename.svg") |
|
182 | + && file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$basename.png")) { |
|
183 | + $path = \OC::$WEBROOT."/themes/$theme/core/img/$basename.png"; |
|
184 | + } elseif (file_exists(\OC::$SERVERROOT."/core/img/$image")) { |
|
185 | + $path = \OC::$WEBROOT."/core/img/$image"; |
|
186 | 186 | } |
187 | 187 | |
188 | - if($path !== '') { |
|
188 | + if ($path !== '') { |
|
189 | 189 | $cache->set($cacheKey, $path); |
190 | 190 | return $path; |
191 | 191 | } else { |
192 | - throw new RuntimeException('image not found: image:' . $image . ' webroot:' . \OC::$WEBROOT . ' serverroot:' . \OC::$SERVERROOT); |
|
192 | + throw new RuntimeException('image not found: image:'.$image.' webroot:'.\OC::$WEBROOT.' serverroot:'.\OC::$SERVERROOT); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $separator = $url[0] === '/' ? '' : '/'; |
204 | 204 | |
205 | 205 | if (\OC::$CLI && !defined('PHPUNIT_RUN')) { |
206 | - return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/') . '/' . ltrim($url, '/'); |
|
206 | + return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/').'/'.ltrim($url, '/'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | // The ownCloud web root can already be prepended. |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | : \OC::$WEBROOT; |
213 | 213 | |
214 | 214 | $request = \OC::$server->getRequest(); |
215 | - return $request->getServerProtocol() . '://' . $request->getServerHost() . $webRoot . $separator . $url; |
|
215 | + return $request->getServerProtocol().'://'.$request->getServerHost().$webRoot.$separator.$url; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param callable $callback |
36 | 36 | */ |
37 | 37 | public function listen($scope, $method, callable $callback) { |
38 | - $eventName = $scope . '::' . $method; |
|
38 | + $eventName = $scope.'::'.$method; |
|
39 | 39 | if (!isset($this->listeners[$eventName])) { |
40 | 40 | $this->listeners[$eventName] = array(); |
41 | 41 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $names = array(); |
54 | 54 | $allNames = array_keys($this->listeners); |
55 | 55 | if ($scope and $method) { |
56 | - $name = $scope . '::' . $method; |
|
56 | + $name = $scope.'::'.$method; |
|
57 | 57 | if (isset($this->listeners[$name])) { |
58 | 58 | $names[] = $name; |
59 | 59 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param array $arguments optional |
94 | 94 | */ |
95 | 95 | protected function emit($scope, $method, array $arguments = array()) { |
96 | - $eventName = $scope . '::' . $method; |
|
96 | + $eventName = $scope.'::'.$method; |
|
97 | 97 | if (isset($this->listeners[$eventName])) { |
98 | 98 | foreach ($this->listeners[$eventName] as $callback) { |
99 | 99 | call_user_func_array($callback, $arguments); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $data = @simplexml_load_string($body); |
98 | 98 | libxml_disable_entity_loader($loadEntities); |
99 | 99 | |
100 | - if($data === false) { |
|
100 | + if ($data === false) { |
|
101 | 101 | libxml_clear_errors(); |
102 | 102 | $this->logger->error( |
103 | 103 | sprintf('Could not get %s, content was no valid XML', $action), |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $client = $this->httpClientService->newClient(); |
128 | 128 | try { |
129 | 129 | $response = $client->get( |
130 | - $this->getAppStoreUrl() . '/content/categories', |
|
130 | + $this->getAppStoreUrl().'/content/categories', |
|
131 | 131 | [ |
132 | 132 | 'timeout' => 5, |
133 | 133 | 'query' => [ |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ], |
136 | 136 | ] |
137 | 137 | ); |
138 | - } catch(\Exception $e) { |
|
138 | + } catch (\Exception $e) { |
|
139 | 139 | $this->logger->error( |
140 | 140 | sprintf('Could not get categories: %s', $e->getMessage()), |
141 | 141 | [ |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | $data = $this->loadData($response->getBody(), 'categories'); |
149 | - if($data === null) { |
|
149 | + if ($data === null) { |
|
150 | 150 | return null; |
151 | 151 | } |
152 | 152 | |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | $cats = []; |
155 | 155 | |
156 | 156 | foreach ($tmp->category as $value) { |
157 | - $id = (int)$value->id; |
|
158 | - $name = (string)$value->name; |
|
157 | + $id = (int) $value->id; |
|
158 | + $name = (string) $value->name; |
|
159 | 159 | $cats[$id] = $name; |
160 | 160 | } |
161 | 161 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $client = $this->httpClientService->newClient(); |
179 | 179 | try { |
180 | 180 | $response = $client->get( |
181 | - $this->getAppStoreUrl() . '/content/data', |
|
181 | + $this->getAppStoreUrl().'/content/data', |
|
182 | 182 | [ |
183 | 183 | 'timeout' => 5, |
184 | 184 | 'query' => [ |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | ], |
193 | 193 | ] |
194 | 194 | ); |
195 | - } catch(\Exception $e) { |
|
195 | + } catch (\Exception $e) { |
|
196 | 196 | $this->logger->error( |
197 | 197 | sprintf('Could not get applications: %s', $e->getMessage()), |
198 | 198 | [ |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | $data = $this->loadData($response->getBody(), 'applications'); |
206 | - if($data === null) { |
|
206 | + if ($data === null) { |
|
207 | 207 | return []; |
208 | 208 | } |
209 | 209 | |
@@ -213,23 +213,23 @@ discard block |
||
213 | 213 | $apps = []; |
214 | 214 | for ($i = 0; $i < $tmpCount; $i++) { |
215 | 215 | $app = []; |
216 | - $app['id'] = (string)$tmp[$i]->id; |
|
217 | - $app['name'] = (string)$tmp[$i]->name; |
|
218 | - $app['label'] = (string)$tmp[$i]->label; |
|
219 | - $app['version'] = (string)$tmp[$i]->version; |
|
220 | - $app['type'] = (string)$tmp[$i]->typeid; |
|
221 | - $app['typename'] = (string)$tmp[$i]->typename; |
|
222 | - $app['personid'] = (string)$tmp[$i]->personid; |
|
223 | - $app['profilepage'] = (string)$tmp[$i]->profilepage; |
|
224 | - $app['license'] = (string)$tmp[$i]->license; |
|
225 | - $app['detailpage'] = (string)$tmp[$i]->detailpage; |
|
226 | - $app['preview'] = (string)$tmp[$i]->smallpreviewpic1; |
|
227 | - $app['preview-full'] = (string)$tmp[$i]->previewpic1; |
|
216 | + $app['id'] = (string) $tmp[$i]->id; |
|
217 | + $app['name'] = (string) $tmp[$i]->name; |
|
218 | + $app['label'] = (string) $tmp[$i]->label; |
|
219 | + $app['version'] = (string) $tmp[$i]->version; |
|
220 | + $app['type'] = (string) $tmp[$i]->typeid; |
|
221 | + $app['typename'] = (string) $tmp[$i]->typename; |
|
222 | + $app['personid'] = (string) $tmp[$i]->personid; |
|
223 | + $app['profilepage'] = (string) $tmp[$i]->profilepage; |
|
224 | + $app['license'] = (string) $tmp[$i]->license; |
|
225 | + $app['detailpage'] = (string) $tmp[$i]->detailpage; |
|
226 | + $app['preview'] = (string) $tmp[$i]->smallpreviewpic1; |
|
227 | + $app['preview-full'] = (string) $tmp[$i]->previewpic1; |
|
228 | 228 | $app['changed'] = strtotime($tmp[$i]->changed); |
229 | - $app['description'] = (string)$tmp[$i]->description; |
|
230 | - $app['score'] = (string)$tmp[$i]->score; |
|
231 | - $app['downloads'] = (int)$tmp[$i]->downloads; |
|
232 | - $app['level'] = (int)$tmp[$i]->approved; |
|
229 | + $app['description'] = (string) $tmp[$i]->description; |
|
230 | + $app['score'] = (string) $tmp[$i]->score; |
|
231 | + $app['downloads'] = (int) $tmp[$i]->downloads; |
|
232 | + $app['level'] = (int) $tmp[$i]->approved; |
|
233 | 233 | |
234 | 234 | $apps[] = $app; |
235 | 235 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $client = $this->httpClientService->newClient(); |
256 | 256 | try { |
257 | 257 | $response = $client->get( |
258 | - $this->getAppStoreUrl() . '/content/data/' . urlencode($id), |
|
258 | + $this->getAppStoreUrl().'/content/data/'.urlencode($id), |
|
259 | 259 | [ |
260 | 260 | 'timeout' => 5, |
261 | 261 | 'query' => [ |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | ], |
264 | 264 | ] |
265 | 265 | ); |
266 | - } catch(\Exception $e) { |
|
266 | + } catch (\Exception $e) { |
|
267 | 267 | $this->logger->error( |
268 | 268 | sprintf('Could not get application: %s', $e->getMessage()), |
269 | 269 | [ |
@@ -274,34 +274,34 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | $data = $this->loadData($response->getBody(), 'application'); |
277 | - if($data === null) { |
|
277 | + if ($data === null) { |
|
278 | 278 | return null; |
279 | 279 | } |
280 | 280 | |
281 | 281 | $tmp = $data->data->content; |
282 | 282 | if (is_null($tmp)) { |
283 | - \OCP\Util::writeLog('core', 'No update found at the Nextcloud appstore for app ' . $id, \OCP\Util::DEBUG); |
|
283 | + \OCP\Util::writeLog('core', 'No update found at the Nextcloud appstore for app '.$id, \OCP\Util::DEBUG); |
|
284 | 284 | return null; |
285 | 285 | } |
286 | 286 | |
287 | 287 | $app = []; |
288 | - $app['id'] = (int)$id; |
|
289 | - $app['name'] = (string)$tmp->name; |
|
290 | - $app['version'] = (string)$tmp->version; |
|
291 | - $app['type'] = (string)$tmp->typeid; |
|
292 | - $app['label'] = (string)$tmp->label; |
|
293 | - $app['typename'] = (string)$tmp->typename; |
|
294 | - $app['personid'] = (string)$tmp->personid; |
|
295 | - $app['profilepage'] = (string)$tmp->profilepage; |
|
296 | - $app['detailpage'] = (string)$tmp->detailpage; |
|
297 | - $app['preview1'] = (string)$tmp->smallpreviewpic1; |
|
298 | - $app['preview2'] = (string)$tmp->smallpreviewpic2; |
|
299 | - $app['preview3'] = (string)$tmp->smallpreviewpic3; |
|
288 | + $app['id'] = (int) $id; |
|
289 | + $app['name'] = (string) $tmp->name; |
|
290 | + $app['version'] = (string) $tmp->version; |
|
291 | + $app['type'] = (string) $tmp->typeid; |
|
292 | + $app['label'] = (string) $tmp->label; |
|
293 | + $app['typename'] = (string) $tmp->typename; |
|
294 | + $app['personid'] = (string) $tmp->personid; |
|
295 | + $app['profilepage'] = (string) $tmp->profilepage; |
|
296 | + $app['detailpage'] = (string) $tmp->detailpage; |
|
297 | + $app['preview1'] = (string) $tmp->smallpreviewpic1; |
|
298 | + $app['preview2'] = (string) $tmp->smallpreviewpic2; |
|
299 | + $app['preview3'] = (string) $tmp->smallpreviewpic3; |
|
300 | 300 | $app['changed'] = strtotime($tmp->changed); |
301 | - $app['description'] = (string)$tmp->description; |
|
302 | - $app['detailpage'] = (string)$tmp->detailpage; |
|
303 | - $app['score'] = (int)$tmp->score; |
|
304 | - $app['level'] = (int)$tmp->approved; |
|
301 | + $app['description'] = (string) $tmp->description; |
|
302 | + $app['detailpage'] = (string) $tmp->detailpage; |
|
303 | + $app['score'] = (int) $tmp->score; |
|
304 | + $app['level'] = (int) $tmp->approved; |
|
305 | 305 | |
306 | 306 | return $app; |
307 | 307 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | if (!$this->isAppStoreEnabled()) { |
317 | 317 | return null; |
318 | 318 | } |
319 | - $url = $this->getAppStoreUrl() . '/content/download/' . urlencode($id) . '/1'; |
|
319 | + $url = $this->getAppStoreUrl().'/content/download/'.urlencode($id).'/1'; |
|
320 | 320 | $client = $this->httpClientService->newClient(); |
321 | 321 | try { |
322 | 322 | $response = $client->get( |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | ], |
329 | 329 | ] |
330 | 330 | ); |
331 | - } catch(\Exception $e) { |
|
331 | + } catch (\Exception $e) { |
|
332 | 332 | $this->logger->error( |
333 | 333 | sprintf('Could not get application download URL: %s', $e->getMessage()), |
334 | 334 | [ |
@@ -339,14 +339,14 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | $data = $this->loadData($response->getBody(), 'application download URL'); |
342 | - if($data === null) { |
|
342 | + if ($data === null) { |
|
343 | 343 | return null; |
344 | 344 | } |
345 | 345 | |
346 | 346 | $tmp = $data->data->content; |
347 | 347 | $app = []; |
348 | 348 | if (isset($tmp->downloadlink)) { |
349 | - $app['downloadlink'] = (string)$tmp->downloadlink; |
|
349 | + $app['downloadlink'] = (string) $tmp->downloadlink; |
|
350 | 350 | } else { |
351 | 351 | $app['downloadlink'] = ''; |
352 | 352 | } |
@@ -41,6 +41,6 @@ |
||
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function getResourcePath() { |
44 | - return $this->webPath . '/' . $this->resource; |
|
44 | + return $this->webPath.'/'.$this->resource; |
|
45 | 45 | } |
46 | 46 | } |