@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | |
134 | 134 | // Check that all parameters from $event exist in $previousEvent |
135 | 135 | foreach ($params1 as $key => $parameter) { |
136 | - if (preg_match('/^' . $mergeParameter . '(\d+)?$/', $key)) { |
|
136 | + if (preg_match('/^'.$mergeParameter.'(\d+)?$/', $key)) { |
|
137 | 137 | if (!$this->checkParameterAlreadyExits($params, $mergeParameter, $parameter)) { |
138 | 138 | $combined++; |
139 | - $params[$mergeParameter . $combined] = $parameter; |
|
139 | + $params[$mergeParameter.$combined] = $parameter; |
|
140 | 140 | } |
141 | 141 | continue; |
142 | 142 | } |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | |
152 | 152 | // Check that all parameters from $previousEvent exist in $event |
153 | 153 | foreach ($params2 as $key => $parameter) { |
154 | - if (preg_match('/^' . $mergeParameter . '(\d+)?$/', $key)) { |
|
154 | + if (preg_match('/^'.$mergeParameter.'(\d+)?$/', $key)) { |
|
155 | 155 | if (!$this->checkParameterAlreadyExits($params, $mergeParameter, $parameter)) { |
156 | 156 | $combined++; |
157 | - $params[$mergeParameter . $combined] = $parameter; |
|
157 | + $params[$mergeParameter.$combined] = $parameter; |
|
158 | 158 | } |
159 | 159 | continue; |
160 | 160 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | protected function checkParameterAlreadyExits($parameters, $mergeParameter, $parameter) { |
180 | 180 | foreach ($parameters as $key => $param) { |
181 | - if (preg_match('/^' . $mergeParameter . '(\d+)?$/', $key)) { |
|
181 | + if (preg_match('/^'.$mergeParameter.'(\d+)?$/', $key)) { |
|
182 | 182 | if ($param === $parameter) { |
183 | 183 | return true; |
184 | 184 | } |
@@ -196,30 +196,30 @@ discard block |
||
196 | 196 | protected function getExtendedSubject($subject, $parameter, $counter) { |
197 | 197 | switch ($counter) { |
198 | 198 | case 1: |
199 | - $replacement = '{' . $parameter . '1}'; |
|
199 | + $replacement = '{'.$parameter.'1}'; |
|
200 | 200 | break; |
201 | 201 | case 2: |
202 | 202 | $replacement = $this->l10n->t( |
203 | 203 | '%1$s and %2$s', |
204 | - ['{' . $parameter . '2}', '{' . $parameter . '1}'] |
|
204 | + ['{'.$parameter.'2}', '{'.$parameter.'1}'] |
|
205 | 205 | ); |
206 | 206 | break; |
207 | 207 | case 3: |
208 | 208 | $replacement = $this->l10n->t( |
209 | 209 | '%1$s, %2$s and %3$s', |
210 | - ['{' . $parameter . '3}', '{' . $parameter . '2}', '{' . $parameter . '1}'] |
|
210 | + ['{'.$parameter.'3}', '{'.$parameter.'2}', '{'.$parameter.'1}'] |
|
211 | 211 | ); |
212 | 212 | break; |
213 | 213 | case 4: |
214 | 214 | $replacement = $this->l10n->t( |
215 | 215 | '%1$s, %2$s, %3$s and %4$s', |
216 | - ['{' . $parameter . '4}', '{' . $parameter . '3}', '{' . $parameter . '2}', '{' . $parameter . '1}'] |
|
216 | + ['{'.$parameter.'4}', '{'.$parameter.'3}', '{'.$parameter.'2}', '{'.$parameter.'1}'] |
|
217 | 217 | ); |
218 | 218 | break; |
219 | 219 | case 5: |
220 | 220 | $replacement = $this->l10n->t( |
221 | 221 | '%1$s, %2$s, %3$s, %4$s and %5$s', |
222 | - ['{' . $parameter . '5}', '{' . $parameter . '4}', '{' . $parameter . '3}', '{' . $parameter . '2}', '{' . $parameter . '1}'] |
|
222 | + ['{'.$parameter.'5}', '{'.$parameter.'4}', '{'.$parameter.'3}', '{'.$parameter.'2}', '{'.$parameter.'1}'] |
|
223 | 223 | ); |
224 | 224 | break; |
225 | 225 | default: |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | return str_replace( |
230 | - '{' . $parameter . '}', |
|
230 | + '{'.$parameter.'}', |
|
231 | 231 | $replacement, |
232 | 232 | $subject |
233 | 233 | ); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | protected function generateParsedSubject($subject, $parameters) { |
242 | 242 | $placeholders = $replacements = []; |
243 | 243 | foreach ($parameters as $placeholder => $parameter) { |
244 | - $placeholders[] = '{' . $placeholder . '}'; |
|
244 | + $placeholders[] = '{'.$placeholder.'}'; |
|
245 | 245 | if ($parameter['type'] === 'file') { |
246 | 246 | $replacements[] = trim($parameter['path'], '/'); |
247 | 247 | } else if (isset($parameter['name'])) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $folder = $this->appData->getFolder($appName); |
67 | 67 | $gzip = false; |
68 | 68 | $file = $this->getFile($folder, $fileName, $gzip); |
69 | - } catch(NotFoundException $e) { |
|
69 | + } catch (NotFoundException $e) { |
|
70 | 70 | return new NotFoundResponse(); |
71 | 71 | } |
72 | 72 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($encoding !== null && strpos($encoding, 'gzip') !== false) { |
96 | 96 | try { |
97 | 97 | $gzip = true; |
98 | - return $folder->getFile($fileName . '.gzip'); # Safari doesn't like .gz |
|
98 | + return $folder->getFile($fileName.'.gzip'); # Safari doesn't like .gz |
|
99 | 99 | } catch (NotFoundException $e) { |
100 | 100 | // continue |
101 | 101 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $folder = $this->appData->getFolder($appName); |
67 | 67 | $gzip = false; |
68 | 68 | $file = $this->getFile($folder, $fileName, $gzip); |
69 | - } catch(NotFoundException $e) { |
|
69 | + } catch (NotFoundException $e) { |
|
70 | 70 | return new NotFoundResponse(); |
71 | 71 | } |
72 | 72 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($encoding !== null && strpos($encoding, 'gzip') !== false) { |
96 | 96 | try { |
97 | 97 | $gzip = true; |
98 | - return $folder->getFile($fileName . '.gzip'); # Safari doesn't like .gz |
|
98 | + return $folder->getFile($fileName.'.gzip'); # Safari doesn't like .gz |
|
99 | 99 | } catch (NotFoundException $e) { |
100 | 100 | // continue |
101 | 101 | } |
@@ -163,21 +163,21 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public static function cacheEntryFromData($data, IMimeTypeLoader $mimetypeLoader) { |
165 | 165 | //fix types |
166 | - $data['fileid'] = (int)$data['fileid']; |
|
167 | - $data['parent'] = (int)$data['parent']; |
|
166 | + $data['fileid'] = (int) $data['fileid']; |
|
167 | + $data['parent'] = (int) $data['parent']; |
|
168 | 168 | $data['size'] = 0 + $data['size']; |
169 | - $data['mtime'] = (int)$data['mtime']; |
|
170 | - $data['storage_mtime'] = (int)$data['storage_mtime']; |
|
171 | - $data['encryptedVersion'] = (int)$data['encrypted']; |
|
172 | - $data['encrypted'] = (bool)$data['encrypted']; |
|
169 | + $data['mtime'] = (int) $data['mtime']; |
|
170 | + $data['storage_mtime'] = (int) $data['storage_mtime']; |
|
171 | + $data['encryptedVersion'] = (int) $data['encrypted']; |
|
172 | + $data['encrypted'] = (bool) $data['encrypted']; |
|
173 | 173 | $data['storage_id'] = $data['storage']; |
174 | - $data['storage'] = (int)$data['storage']; |
|
174 | + $data['storage'] = (int) $data['storage']; |
|
175 | 175 | $data['mimetype'] = $mimetypeLoader->getMimetypeById($data['mimetype']); |
176 | 176 | $data['mimepart'] = $mimetypeLoader->getMimetypeById($data['mimepart']); |
177 | 177 | if ($data['storage_mtime'] == 0) { |
178 | 178 | $data['storage_mtime'] = $data['mtime']; |
179 | 179 | } |
180 | - $data['permissions'] = (int)$data['permissions']; |
|
180 | + $data['permissions'] = (int) $data['permissions']; |
|
181 | 181 | return new CacheEntry($data); |
182 | 182 | } |
183 | 183 | |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | FROM `*PREFIX*filecache` WHERE `parent` = ? ORDER BY `name` ASC'; |
206 | 206 | $result = $this->connection->executeQuery($sql, [$fileId]); |
207 | 207 | $files = $result->fetchAll(); |
208 | - return array_map(function (array $data) { |
|
209 | - return self::cacheEntryFromData($data, $this->mimetypeLoader);; |
|
208 | + return array_map(function(array $data) { |
|
209 | + return self::cacheEntryFromData($data, $this->mimetypeLoader); ; |
|
210 | 210 | }, $files); |
211 | 211 | } else { |
212 | 212 | return array(); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $queryParts[] = '`storage`'; |
266 | 266 | $params[] = $this->getNumericStorageId(); |
267 | 267 | |
268 | - $queryParts = array_map(function ($item) { |
|
268 | + $queryParts = array_map(function($item) { |
|
269 | 269 | return trim($item, "`"); |
270 | 270 | }, $queryParts); |
271 | 271 | $values = array_combine($queryParts, $params); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | 'path_hash', |
275 | 275 | ]) |
276 | 276 | ) { |
277 | - return (int)$this->connection->lastInsertId('*PREFIX*filecache'); |
|
277 | + return (int) $this->connection->lastInsertId('*PREFIX*filecache'); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | // The file was created in the mean time |
@@ -312,10 +312,10 @@ discard block |
||
312 | 312 | |
313 | 313 | // don't update if the data we try to set is the same as the one in the record |
314 | 314 | // some databases (Postgres) don't like superfluous updates |
315 | - $sql = 'UPDATE `*PREFIX*filecache` SET ' . implode(' = ?, ', $queryParts) . '=? ' . |
|
316 | - 'WHERE (' . |
|
317 | - implode(' <> ? OR ', $queryParts) . ' <> ? OR ' . |
|
318 | - implode(' IS NULL OR ', $queryParts) . ' IS NULL' . |
|
315 | + $sql = 'UPDATE `*PREFIX*filecache` SET '.implode(' = ?, ', $queryParts).'=? '. |
|
316 | + 'WHERE ('. |
|
317 | + implode(' <> ? OR ', $queryParts).' <> ? OR '. |
|
318 | + implode(' IS NULL OR ', $queryParts).' IS NULL'. |
|
319 | 319 | ') AND `fileid` = ? '; |
320 | 320 | $this->connection->executeQuery($sql, $params); |
321 | 321 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | } |
368 | 368 | $params[] = $value; |
369 | - $queryParts[] = '`' . $name . '`'; |
|
369 | + $queryParts[] = '`'.$name.'`'; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | return array($queryParts, $params); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | return -1; |
409 | 409 | } else { |
410 | 410 | $parent = $this->getParentPath($file); |
411 | - return (int)$this->getId($parent); |
|
411 | + return (int) $this->getId($parent); |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | */ |
455 | 455 | private function getSubFolders($entry) { |
456 | 456 | $children = $this->getFolderContentsById($entry['fileid']); |
457 | - return array_filter($children, function ($child) { |
|
457 | + return array_filter($children, function($child) { |
|
458 | 458 | return $child['mimetype'] === 'httpd/unix-directory'; |
459 | 459 | }); |
460 | 460 | } |
@@ -517,10 +517,10 @@ discard block |
||
517 | 517 | list($targetStorageId, $targetPath) = $this->getMoveInfo($targetPath); |
518 | 518 | |
519 | 519 | if (is_null($sourceStorageId) || $sourceStorageId === false) { |
520 | - throw new \Exception('Invalid source storage id: ' . $sourceStorageId); |
|
520 | + throw new \Exception('Invalid source storage id: '.$sourceStorageId); |
|
521 | 521 | } |
522 | 522 | if (is_null($targetStorageId) || $targetStorageId === false) { |
523 | - throw new \Exception('Invalid target storage id: ' . $targetStorageId); |
|
523 | + throw new \Exception('Invalid target storage id: '.$targetStorageId); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | $this->connection->beginTransaction(); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | ->set('path_hash', $fun->md5($newPathFunction)) |
540 | 540 | ->set('path', $newPathFunction) |
541 | 541 | ->where($query->expr()->eq('storage', $query->createNamedParameter($sourceStorageId, IQueryBuilder::PARAM_INT))) |
542 | - ->andWhere($query->expr()->like('path', $query->createNamedParameter($this->connection->escapeLikeParameter($sourcePath) . '/%'))); |
|
542 | + ->andWhere($query->expr()->like('path', $query->createNamedParameter($this->connection->escapeLikeParameter($sourcePath).'/%'))); |
|
543 | 543 | |
544 | 544 | try { |
545 | 545 | $query->execute(); |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $sql = 'SELECT `size` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?'; |
589 | 589 | $result = $this->connection->executeQuery($sql, array($this->getNumericStorageId(), $pathHash)); |
590 | 590 | if ($row = $result->fetch()) { |
591 | - if ((int)$row['size'] === -1) { |
|
591 | + if ((int) $row['size'] === -1) { |
|
592 | 592 | return self::SHALLOW; |
593 | 593 | } else { |
594 | 594 | return self::COMPLETE; |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | private function searchResultToCacheEntries(Statement $result) { |
638 | 638 | $files = $result->fetchAll(); |
639 | 639 | |
640 | - return array_map(function (array $data) { |
|
640 | + return array_map(function(array $data) { |
|
641 | 641 | return self::cacheEntryFromData($data, $this->mimetypeLoader); |
642 | 642 | }, $files); |
643 | 643 | } |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | $where = '`mimepart` = ?'; |
657 | 657 | } |
658 | 658 | $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `storage_mtime`, `mtime`, `encrypted`, `etag`, `permissions`, `checksum` |
659 | - FROM `*PREFIX*filecache` WHERE ' . $where . ' AND `storage` = ?'; |
|
659 | + FROM `*PREFIX*filecache` WHERE ' . $where.' AND `storage` = ?'; |
|
660 | 660 | $mimetype = $this->mimetypeLoader->getId($mimetype); |
661 | 661 | $result = $this->connection->executeQuery($sql, array($mimetype, $this->getNumericStorageId())); |
662 | 662 | |
@@ -707,20 +707,20 @@ discard block |
||
707 | 707 | * @return ICacheEntry[] file data |
708 | 708 | */ |
709 | 709 | public function searchByTag($tag, $userId) { |
710 | - $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, ' . |
|
711 | - '`mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, ' . |
|
712 | - '`encrypted`, `etag`, `permissions`, `checksum` ' . |
|
713 | - 'FROM `*PREFIX*filecache` `file`, ' . |
|
714 | - '`*PREFIX*vcategory_to_object` `tagmap`, ' . |
|
715 | - '`*PREFIX*vcategory` `tag` ' . |
|
710 | + $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, '. |
|
711 | + '`mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, '. |
|
712 | + '`encrypted`, `etag`, `permissions`, `checksum` '. |
|
713 | + 'FROM `*PREFIX*filecache` `file`, '. |
|
714 | + '`*PREFIX*vcategory_to_object` `tagmap`, '. |
|
715 | + '`*PREFIX*vcategory` `tag` '. |
|
716 | 716 | // JOIN filecache to vcategory_to_object |
717 | - 'WHERE `file`.`fileid` = `tagmap`.`objid` ' . |
|
717 | + 'WHERE `file`.`fileid` = `tagmap`.`objid` '. |
|
718 | 718 | // JOIN vcategory_to_object to vcategory |
719 | - 'AND `tagmap`.`type` = `tag`.`type` ' . |
|
720 | - 'AND `tagmap`.`categoryid` = `tag`.`id` ' . |
|
719 | + 'AND `tagmap`.`type` = `tag`.`type` '. |
|
720 | + 'AND `tagmap`.`categoryid` = `tag`.`id` '. |
|
721 | 721 | // conditions |
722 | - 'AND `file`.`storage` = ? ' . |
|
723 | - 'AND `tag`.`type` = \'files\' ' . |
|
722 | + 'AND `file`.`storage` = ? '. |
|
723 | + 'AND `tag`.`type` = \'files\' '. |
|
724 | 724 | 'AND `tag`.`uid` = ? '; |
725 | 725 | if (is_int($tag)) { |
726 | 726 | $sql .= 'AND `tag`.`id` = ? '; |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | |
739 | 739 | $files = $result->fetchAll(); |
740 | 740 | |
741 | - return array_map(function (array $data) { |
|
741 | + return array_map(function(array $data) { |
|
742 | 742 | return self::cacheEntryFromData($data, $this->mimetypeLoader); |
743 | 743 | }, $files); |
744 | 744 | } |
@@ -774,8 +774,8 @@ discard block |
||
774 | 774 | } |
775 | 775 | if (isset($entry['mimetype']) && $entry['mimetype'] === 'httpd/unix-directory') { |
776 | 776 | $id = $entry['fileid']; |
777 | - $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 ' . |
|
778 | - 'FROM `*PREFIX*filecache` ' . |
|
777 | + $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 '. |
|
778 | + 'FROM `*PREFIX*filecache` '. |
|
779 | 779 | 'WHERE `parent` = ? AND `storage` = ?'; |
780 | 780 | $result = $this->connection->executeQuery($sql, array($id, $this->getNumericStorageId())); |
781 | 781 | if ($row = $result->fetch()) { |
@@ -171,14 +171,14 @@ |
||
171 | 171 | protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { |
172 | 172 | $qb = $this->connection->getQueryBuilder(); |
173 | 173 | |
174 | - $qb->select('d.' . $deleteId) |
|
174 | + $qb->select('d.'.$deleteId) |
|
175 | 175 | ->from($deleteTable, 'd') |
176 | - ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.' . $deleteId, 's.' . $sourceId)) |
|
176 | + ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.'.$deleteId, 's.'.$sourceId)) |
|
177 | 177 | ->where( |
178 | 178 | $qb->expr()->eq('d.type', $qb->expr()->literal('files')) |
179 | 179 | ) |
180 | 180 | ->andWhere( |
181 | - $qb->expr()->isNull('s.' . $sourceNullColumn) |
|
181 | + $qb->expr()->isNull('s.'.$sourceNullColumn) |
|
182 | 182 | ); |
183 | 183 | $result = $qb->execute(); |
184 | 184 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return TemplateResponse|RedirectResponse |
86 | 86 | */ |
87 | 87 | public function showRenewPasswordForm($user) { |
88 | - if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
88 | + if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
89 | 89 | return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
90 | 90 | } |
91 | 91 | $parameters = []; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return RedirectResponse |
130 | 130 | */ |
131 | 131 | public function tryRenewPassword($user, $oldPassword, $newPassword) { |
132 | - if($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
132 | + if ($this->config->getUserValue($user, 'user_ldap', 'needsPasswordReset') !== 'true') { |
|
133 | 133 | return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); |
134 | 134 | } |
135 | 135 | $args = !is_null($user) ? ['user' => $user] : []; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // we shall not log on RemoteException |
55 | 55 | $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger())); |
56 | 56 | } |
57 | - $server->on('beforeMethod', function () use ($e) { |
|
57 | + $server->on('beforeMethod', function() use ($e) { |
|
58 | 58 | if ($e instanceof RemoteException) { |
59 | 59 | switch ($e->getCode()) { |
60 | 60 | case OC_Response::STATUS_SERVICE_UNAVAILABLE: |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $server->exec(); |
71 | 71 | } else { |
72 | 72 | $statusCode = OC_Response::STATUS_INTERNAL_SERVER_ERROR; |
73 | - if ($e instanceof \OC\ServiceUnavailableException ) { |
|
73 | + if ($e instanceof \OC\ServiceUnavailableException) { |
|
74 | 74 | $statusCode = OC_Response::STATUS_SERVICE_UNAVAILABLE; |
75 | 75 | } |
76 | 76 | if ($e instanceof RemoteException) { |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | return $services[$service]; |
104 | 104 | } |
105 | 105 | |
106 | - return \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service); |
|
106 | + return \OC::$server->getConfig()->getAppValue('core', 'remote_'.$service); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | try { |
110 | - require_once __DIR__ . '/lib/base.php'; |
|
110 | + require_once __DIR__.'/lib/base.php'; |
|
111 | 111 | |
112 | 112 | // All resources served via the DAV endpoint should have the strictest possible |
113 | 113 | // policy. Exempted from this is the SabreDAV browser plugin which overwrites |
@@ -128,18 +128,18 @@ discard block |
||
128 | 128 | if (!$pos = strpos($pathInfo, '/', 1)) { |
129 | 129 | $pos = strlen($pathInfo); |
130 | 130 | } |
131 | - $service=substr($pathInfo, 1, $pos-1); |
|
131 | + $service = substr($pathInfo, 1, $pos - 1); |
|
132 | 132 | |
133 | 133 | $file = resolveService($service); |
134 | 134 | |
135 | - if(is_null($file)) { |
|
135 | + if (is_null($file)) { |
|
136 | 136 | throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND); |
137 | 137 | } |
138 | 138 | |
139 | - $file=ltrim($file, '/'); |
|
139 | + $file = ltrim($file, '/'); |
|
140 | 140 | |
141 | - $parts=explode('/', $file, 2); |
|
142 | - $app=$parts[0]; |
|
141 | + $parts = explode('/', $file, 2); |
|
142 | + $app = $parts[0]; |
|
143 | 143 | |
144 | 144 | // Load all required applications |
145 | 145 | \OC::$REQUESTEDAPP = $app; |
@@ -148,17 +148,17 @@ discard block |
||
148 | 148 | |
149 | 149 | switch ($app) { |
150 | 150 | case 'core': |
151 | - $file = OC::$SERVERROOT .'/'. $file; |
|
151 | + $file = OC::$SERVERROOT.'/'.$file; |
|
152 | 152 | break; |
153 | 153 | default: |
154 | 154 | if (!\OC::$server->getAppManager()->isInstalled($app)) { |
155 | - throw new RemoteException('App not installed: ' . $app); |
|
155 | + throw new RemoteException('App not installed: '.$app); |
|
156 | 156 | } |
157 | 157 | OC_App::loadApp($app); |
158 | - $file = OC_App::getAppPath($app) .'/'. $parts[1]; |
|
158 | + $file = OC_App::getAppPath($app).'/'.$parts[1]; |
|
159 | 159 | break; |
160 | 160 | } |
161 | - $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; |
|
161 | + $baseuri = OC::$WEBROOT.'/remote.php/'.$service.'/'; |
|
162 | 162 | require_once $file; |
163 | 163 | |
164 | 164 | } catch (Exception $ex) { |
@@ -102,13 +102,13 @@ |
||
102 | 102 | if ($generatePasswordResetToken) { |
103 | 103 | $token = $this->secureRandom->generate( |
104 | 104 | 21, |
105 | - ISecureRandom::CHAR_DIGITS . |
|
106 | - ISecureRandom::CHAR_LOWER . |
|
105 | + ISecureRandom::CHAR_DIGITS. |
|
106 | + ISecureRandom::CHAR_LOWER. |
|
107 | 107 | ISecureRandom::CHAR_UPPER |
108 | 108 | ); |
109 | - $tokenValue = $this->timeFactory->getTime() . ':' . $token; |
|
109 | + $tokenValue = $this->timeFactory->getTime().':'.$token; |
|
110 | 110 | $mailAddress = (null !== $user->getEMailAddress()) ? $user->getEMailAddress() : ''; |
111 | - $encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress . $this->config->getSystemValue('secret')); |
|
111 | + $encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress.$this->config->getSystemValue('secret')); |
|
112 | 112 | $this->config->setUserValue($user->getUID(), 'core', 'lostpassword', $encryptedValue); |
113 | 113 | $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $user->getUID(), 'token' => $token]); |
114 | 114 | } else { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param \OCP\IL10N $l10n |
47 | 47 | * @param Defaults $theme |
48 | 48 | */ |
49 | - public function __construct($template, $requestToken, $l10n, $theme ) { |
|
49 | + public function __construct($template, $requestToken, $l10n, $theme) { |
|
50 | 50 | $this->vars = array(); |
51 | 51 | $this->vars['requesttoken'] = $requestToken; |
52 | 52 | $this->l10n = $l10n; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { |
65 | 65 | // Check if the app is in the app folder or in the root |
66 | - if( file_exists($app_dir.'/templates/' )) { |
|
66 | + if (file_exists($app_dir.'/templates/')) { |
|
67 | 67 | return [ |
68 | 68 | $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', |
69 | 69 | $app_dir.'/templates/', |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * If the key existed before, it will be overwritten |
100 | 100 | */ |
101 | - public function assign( $key, $value) { |
|
101 | + public function assign($key, $value) { |
|
102 | 102 | $this->vars[$key] = $value; |
103 | 103 | return true; |
104 | 104 | } |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | * exists, the value will be appended. It can be accessed via |
114 | 114 | * $_[$key][$position] in the template. |
115 | 115 | */ |
116 | - public function append( $key, $value ) { |
|
117 | - if( array_key_exists( $key, $this->vars )) { |
|
116 | + public function append($key, $value) { |
|
117 | + if (array_key_exists($key, $this->vars)) { |
|
118 | 118 | $this->vars[$key][] = $value; |
119 | 119 | } |
120 | - else{ |
|
121 | - $this->vars[$key] = array( $value ); |
|
120 | + else { |
|
121 | + $this->vars[$key] = array($value); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function printPage() { |
132 | 132 | $data = $this->fetchPage(); |
133 | - if( $data === false ) { |
|
133 | + if ($data === false) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | - else{ |
|
136 | + else { |
|
137 | 137 | print $data; |
138 | 138 | return true; |
139 | 139 | } |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | $l = $this->l10n; |
167 | 167 | $theme = $this->theme; |
168 | 168 | |
169 | - if( !is_null($additionalParams)) { |
|
170 | - $_ = array_merge( $additionalParams, $this->vars ); |
|
169 | + if (!is_null($additionalParams)) { |
|
170 | + $_ = array_merge($additionalParams, $this->vars); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | // Include |