@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function getThemedIcon(string $app, string $image): Response { |
92 | 92 | try { |
93 | - $iconFile = $this->imageManager->getCachedImage('icon-' . $app . '-' . str_replace('/', '_',$image)); |
|
93 | + $iconFile = $this->imageManager->getCachedImage('icon-'.$app.'-'.str_replace('/', '_', $image)); |
|
94 | 94 | } catch (NotFoundException $exception) { |
95 | 95 | $icon = $this->iconBuilder->colorSvg($app, $image); |
96 | 96 | if ($icon === false || $icon === '') { |
97 | 97 | return new NotFoundResponse(); |
98 | 98 | } |
99 | - $iconFile = $this->imageManager->setCachedImage('icon-' . $app . '-' . str_replace('/', '_',$image), $icon); |
|
99 | + $iconFile = $this->imageManager->setCachedImage('icon-'.$app.'-'.str_replace('/', '_', $image), $icon); |
|
100 | 100 | } |
101 | 101 | if ($iconFile !== false) { |
102 | 102 | $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/svg+xml']); |
@@ -127,17 +127,17 @@ discard block |
||
127 | 127 | } |
128 | 128 | if ($iconFile === null && $this->imageManager->shouldReplaceIcons()) { |
129 | 129 | try { |
130 | - $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app); |
|
130 | + $iconFile = $this->imageManager->getCachedImage('favIcon-'.$app); |
|
131 | 131 | } catch (NotFoundException $exception) { |
132 | 132 | $icon = $this->iconBuilder->getFavicon($app); |
133 | - $iconFile = $this->imageManager->setCachedImage('favIcon-' . $app, $icon); |
|
133 | + $iconFile = $this->imageManager->setCachedImage('favIcon-'.$app, $icon); |
|
134 | 134 | } |
135 | 135 | if ($iconFile !== false) { |
136 | 136 | $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/x-icon']); |
137 | 137 | } |
138 | 138 | } |
139 | - if($response === null) { |
|
140 | - $fallbackLogo = \OC::$SERVERROOT . '/core/img/favicon.png'; |
|
139 | + if ($response === null) { |
|
140 | + $fallbackLogo = \OC::$SERVERROOT.'/core/img/favicon.png'; |
|
141 | 141 | $response = new DataDisplayResponse($this->fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/x-icon']); |
142 | 142 | } |
143 | 143 | $response->cacheFor(86400); |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | } |
164 | 164 | if ($this->imageManager->shouldReplaceIcons()) { |
165 | 165 | try { |
166 | - $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app); |
|
166 | + $iconFile = $this->imageManager->getCachedImage('touchIcon-'.$app); |
|
167 | 167 | } catch (NotFoundException $exception) { |
168 | 168 | $icon = $this->iconBuilder->getTouchIcon($app); |
169 | - $iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app, $icon); |
|
169 | + $iconFile = $this->imageManager->setCachedImage('touchIcon-'.$app, $icon); |
|
170 | 170 | } |
171 | 171 | if ($iconFile !== false) { |
172 | 172 | $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/png']); |
173 | 173 | } |
174 | 174 | } |
175 | - if($response === null) { |
|
176 | - $fallbackLogo = \OC::$SERVERROOT . '/core/img/favicon-touch.png'; |
|
175 | + if ($response === null) { |
|
176 | + $fallbackLogo = \OC::$SERVERROOT.'/core/img/favicon-touch.png'; |
|
177 | 177 | $response = new DataDisplayResponse($this->fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/png']); |
178 | 178 | } |
179 | 179 | $response->cacheFor(86400); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @throws ShareNotFound |
95 | 95 | */ |
96 | 96 | public function beforeController($controller, $methodName) { |
97 | - if(!$this->isSharingEnabled()) { |
|
97 | + if (!$this->isSharingEnabled()) { |
|
98 | 98 | throw new NotFoundException('Sharing is disabled.'); |
99 | 99 | } |
100 | 100 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @throws \Exception |
115 | 115 | */ |
116 | 116 | public function afterException($controller, $methodName, \Exception $exception) { |
117 | - if(is_a($exception, NotFoundException::class)) { |
|
117 | + if (is_a($exception, NotFoundException::class)) { |
|
118 | 118 | return new NotFoundResponse(); |
119 | 119 | } |
120 | 120 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | private function isSharingEnabled() { |
152 | 152 | // FIXME: This check is done here since the route is globally defined and not inside the files_sharing app |
153 | 153 | // Check whether the sharing application is enabled |
154 | - if(!$this->appManager->isEnabledForUser($this->appName)) { |
|
154 | + if (!$this->appManager->isEnabledForUser($this->appName)) { |
|
155 | 155 | return false; |
156 | 156 | } |
157 | 157 |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // Check whether public sharing is enabled |
86 | - if($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { |
|
86 | + if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { |
|
87 | 87 | return false; |
88 | 88 | } |
89 | 89 |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $owner = isset($_POST['owner']) ? $_POST['owner'] : null; |
146 | 146 | $sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null; |
147 | 147 | $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; |
148 | - $remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null; |
|
148 | + $remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null; |
|
149 | 149 | $sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null; |
150 | 150 | $ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null; |
151 | 151 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } catch (ProviderCouldNotAddShareException $e) { |
181 | 181 | throw new OCSException($e->getMessage(), 400); |
182 | 182 | } catch (\Exception $e) { |
183 | - throw new OCSException('internal server error, was not able to add share from ' . $remote, 500); |
|
183 | + throw new OCSException('internal server error, was not able to add share from '.$remote, 500); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | return new Http\DataResponse(); |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | |
203 | 203 | $token = $this->request->getParam('token', null); |
204 | 204 | $shareWith = $this->request->getParam('shareWith', null); |
205 | - $permission = (int)$this->request->getParam('permission', null); |
|
206 | - $remoteId = (int)$this->request->getParam('remoteId', null); |
|
205 | + $permission = (int) $this->request->getParam('permission', null); |
|
206 | + $remoteId = (int) $this->request->getParam('remoteId', null); |
|
207 | 207 | |
208 | 208 | if ($id === null || |
209 | 209 | $token === null || |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | } catch (ProviderDoesNotExistsException $e) { |
232 | 232 | throw new OCSException('Server does not support federated cloud sharing', 503); |
233 | 233 | } catch (ShareNotFound $e) { |
234 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
234 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
235 | 235 | } catch (\Exception $e) { |
236 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
236 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | throw new OCSBadRequestException(); |
@@ -267,9 +267,9 @@ discard block |
||
267 | 267 | } catch (ProviderDoesNotExistsException $e) { |
268 | 268 | throw new OCSException('Server does not support federated cloud sharing', 503); |
269 | 269 | } catch (ShareNotFound $e) { |
270 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
270 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
271 | 271 | } catch (\Exception $e) { |
272 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
272 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | return new Http\DataResponse(); |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | } catch (ProviderDoesNotExistsException $e) { |
301 | 301 | throw new OCSException('Server does not support federated cloud sharing', 503); |
302 | 302 | } catch (ShareNotFound $e) { |
303 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
303 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
304 | 304 | } catch (\Exception $e) { |
305 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
305 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | return new Http\DataResponse(); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $notification = ['sharedSecret' => $token]; |
332 | 332 | $provider->notificationReceived('SHARE_UNSHARED', $id, $notification); |
333 | 333 | } catch (\Exception $e) { |
334 | - $this->logger->debug('processing unshare notification failed: ' . $e->getMessage()); |
|
334 | + $this->logger->debug('processing unshare notification failed: '.$e->getMessage()); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | return new Http\DataResponse(); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | try { |
406 | 406 | $provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); |
407 | - $ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions); |
|
407 | + $ocmPermissions = $this->ncPermissions2ocmPermissions((int) $ncPermissions); |
|
408 | 408 | $notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions]; |
409 | 409 | $provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification); |
410 | 410 | } catch (\Exception $e) { |
@@ -25,7 +25,7 @@ |
||
25 | 25 | style('settings', 'settings'); |
26 | 26 | |
27 | 27 | // Do we have some data to inject ? |
28 | -if(is_array($_['serverData'])) { |
|
28 | +if (is_array($_['serverData'])) { |
|
29 | 29 | ?> |
30 | -<span id="serverData" data-server="<?php p(json_encode($_['serverData']));?>"></span> |
|
30 | +<span id="serverData" data-server="<?php p(json_encode($_['serverData'])); ?>"></span> |
|
31 | 31 | <?php } ?> |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | * |
44 | 44 | */ |
45 | 45 | public function run($arguments) { |
46 | - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
46 | + $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); |
|
47 | 47 | $instanceId = $this->config->getSystemValue('instanceid', null); |
48 | 48 | |
49 | - if(!is_string($instanceId) || empty($instanceId)) { |
|
49 | + if (!is_string($instanceId) || empty($instanceId)) { |
|
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - $updaterFolderPath = $dataDir . '/updater-' . $instanceId; |
|
54 | - $backupFolderPath = $updaterFolderPath . '/backups'; |
|
55 | - if(file_exists($backupFolderPath)) { |
|
53 | + $updaterFolderPath = $dataDir.'/updater-'.$instanceId; |
|
54 | + $backupFolderPath = $updaterFolderPath.'/backups'; |
|
55 | + if (file_exists($backupFolderPath)) { |
|
56 | 56 | $this->log->info("$backupFolderPath exists - start to clean it up"); |
57 | 57 | |
58 | 58 | $dirList = []; |
59 | 59 | $dirs = new \DirectoryIterator($backupFolderPath); |
60 | - foreach($dirs as $dir) { |
|
60 | + foreach ($dirs as $dir) { |
|
61 | 61 | // skip files and dot dirs |
62 | 62 | if ($dir->isFile() || $dir->isDot()) { |
63 | 63 | continue; |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | ksort($dirList); |
77 | 77 | // drop the newest 3 directories |
78 | 78 | $dirList = array_slice($dirList, 0, -3); |
79 | - $this->log->info("List of all directories that will be deleted: " . json_encode($dirList)); |
|
79 | + $this->log->info("List of all directories that will be deleted: ".json_encode($dirList)); |
|
80 | 80 | |
81 | - foreach($dirList as $dir) { |
|
81 | + foreach ($dirList as $dir) { |
|
82 | 82 | $this->log->info("Removing $dir ..."); |
83 | 83 | \OC_Helper::rmdirr($dir); |
84 | 84 | } |
@@ -162,7 +162,7 @@ |
||
162 | 162 | $app = strtolower($this->appName); |
163 | 163 | $class = strtolower((new \ReflectionClass($this))->getShortName()); |
164 | 164 | |
165 | - return $app . '.' . $class . '.' . $function; |
|
165 | + return $app.'.'.$class.'.'.$function; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -25,5 +25,5 @@ |
||
25 | 25 | style('accessibility', 'style'); |
26 | 26 | ?> |
27 | 27 | |
28 | -<span id="serverData" data-server="<?php p(json_encode($_['serverData']));?>"></span> |
|
28 | +<span id="serverData" data-server="<?php p(json_encode($_['serverData'])); ?>"></span> |
|
29 | 29 | <span id="accessibility"></span> |
30 | 30 | \ No newline at end of file |
@@ -184,7 +184,7 @@ |
||
184 | 184 | if (is_array($scope)) { |
185 | 185 | parent::setScope(json_encode($scope)); |
186 | 186 | } else { |
187 | - parent::setScope((string)$scope); |
|
187 | + parent::setScope((string) $scope); |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 |