@@ -28,10 +28,10 @@ |
||
28 | 28 | * along with this program. If not, see <http://www.gnu.org/licenses/> |
29 | 29 | * |
30 | 30 | */ |
31 | -require_once __DIR__ . '/lib/versioncheck.php'; |
|
31 | +require_once __DIR__.'/lib/versioncheck.php'; |
|
32 | 32 | |
33 | 33 | try { |
34 | - require_once __DIR__ . '/lib/base.php'; |
|
34 | + require_once __DIR__.'/lib/base.php'; |
|
35 | 35 | |
36 | 36 | OC::handleRequest(); |
37 | 37 | } catch (\OC\ServiceUnavailableException $ex) { |
@@ -23,14 +23,14 @@ |
||
23 | 23 | * along with this program. If not, see <http://www.gnu.org/licenses/> |
24 | 24 | * |
25 | 25 | */ |
26 | -require_once __DIR__ . '/../lib/versioncheck.php'; |
|
27 | -require_once __DIR__ . '/../lib/base.php'; |
|
26 | +require_once __DIR__.'/../lib/versioncheck.php'; |
|
27 | +require_once __DIR__.'/../lib/base.php'; |
|
28 | 28 | |
29 | 29 | header('Content-type: application/xml'); |
30 | 30 | |
31 | 31 | $request = \OC::$server->getRequest(); |
32 | 32 | |
33 | -$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17).'ocs/v1.php/'; |
|
33 | +$url = $request->getServerProtocol().'://'.substr($request->getServerHost().$request->getRequestUri(), 0, -17).'ocs/v1.php/'; |
|
34 | 34 | |
35 | 35 | $writer = new XMLWriter(); |
36 | 36 | $writer->openURI('php://output'); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @psalm-suppress UndefinedDocblockClass |
149 | 149 | * @psalm-suppress UndefinedInterfaceMethod |
150 | 150 | */ |
151 | - $cacheId = $cache->getNumericStorageId() . '/' . $groupFolderStorage->getFolderId(); |
|
151 | + $cacheId = $cache->getNumericStorageId().'/'.$groupFolderStorage->getFolderId(); |
|
152 | 152 | } else { |
153 | 153 | $cacheId = $cache->getNumericStorageId(); |
154 | 154 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | public function supportedEntities(): array { |
182 | - return [ File::class ]; |
|
182 | + return [File::class]; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | public function isAvailableForScope(int $scope): bool { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $tables = $this->getAllNonUTF8BinTables($this->connection); |
79 | 79 | foreach ($tables as $table) { |
80 | 80 | $output->info("Change row format for $table ..."); |
81 | - $query = $this->connection->prepare('ALTER TABLE `' . $table . '` ROW_FORMAT = DYNAMIC;'); |
|
81 | + $query = $this->connection->prepare('ALTER TABLE `'.$table.'` ROW_FORMAT = DYNAMIC;'); |
|
82 | 82 | try { |
83 | 83 | $query->execute(); |
84 | 84 | } catch (DriverException $e) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | $output->info("Change collation for $table ..."); |
93 | - $query = $this->connection->prepare('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET ' . $characterSet . ' COLLATE ' . $characterSet . '_bin;'); |
|
93 | + $query = $this->connection->prepare('ALTER TABLE `'.$table.'` CONVERT TO CHARACTER SET '.$characterSet.' COLLATE '.$characterSet.'_bin;'); |
|
94 | 94 | try { |
95 | 95 | $query->execute(); |
96 | 96 | } catch (DriverException $e) { |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | |
117 | 117 | // fetch tables by columns |
118 | 118 | $statement = $connection->executeQuery( |
119 | - "SELECT DISTINCT(TABLE_NAME) AS `table`" . |
|
120 | - " FROM INFORMATION_SCHEMA . COLUMNS" . |
|
121 | - " WHERE TABLE_SCHEMA = ?" . |
|
122 | - " AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" . |
|
119 | + "SELECT DISTINCT(TABLE_NAME) AS `table`". |
|
120 | + " FROM INFORMATION_SCHEMA . COLUMNS". |
|
121 | + " WHERE TABLE_SCHEMA = ?". |
|
122 | + " AND (COLLATION_NAME <> '".$characterSet."_bin' OR CHARACTER_SET_NAME <> '".$characterSet."')". |
|
123 | 123 | " AND TABLE_NAME LIKE '*PREFIX*%'", |
124 | 124 | [$dbName] |
125 | 125 | ); |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | |
132 | 132 | // fetch tables by collation |
133 | 133 | $statement = $connection->executeQuery( |
134 | - "SELECT DISTINCT(TABLE_NAME) AS `table`" . |
|
135 | - " FROM INFORMATION_SCHEMA . TABLES" . |
|
136 | - " WHERE TABLE_SCHEMA = ?" . |
|
137 | - " AND TABLE_COLLATION <> '" . $characterSet . "_bin'" . |
|
134 | + "SELECT DISTINCT(TABLE_NAME) AS `table`". |
|
135 | + " FROM INFORMATION_SCHEMA . TABLES". |
|
136 | + " WHERE TABLE_SCHEMA = ?". |
|
137 | + " AND TABLE_COLLATION <> '".$characterSet."_bin'". |
|
138 | 138 | " AND TABLE_NAME LIKE '*PREFIX*%'", |
139 | 139 | [$dbName] |
140 | 140 | ); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | parent::__construct($connection, $queryBuilder); |
44 | 44 | |
45 | 45 | $params = $connection->getInner()->getParams(); |
46 | - $this->collation = $params['collation'] ?? (($params['charset'] ?? 'utf8') . '_general_ci'); |
|
46 | + $this->collation = $params['collation'] ?? (($params['charset'] ?? 'utf8').'_general_ci'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function iLike($x, $y, $type = null): string { |
53 | 53 | $x = $this->helper->quoteColumnName($x); |
54 | 54 | $y = $this->helper->quoteColumnName($y); |
55 | - return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->collation . ' LIKE', $y); |
|
55 | + return $this->expressionBuilder->comparison($x, ' COLLATE '.$this->collation.' LIKE', $y); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function castColumn($column, $type): IQueryFunction { |
67 | 67 | switch ($type) { |
68 | 68 | case IQueryBuilder::PARAM_STR: |
69 | - return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS CHAR)'); |
|
69 | + return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS CHAR)'); |
|
70 | 70 | default: |
71 | 71 | return parent::castColumn($column, $type); |
72 | 72 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return \OCP\IL10N |
127 | 127 | */ |
128 | 128 | public function get($app, $lang = null, $locale = null) { |
129 | - return new LazyL10N(function () use ($app, $lang, $locale) { |
|
129 | + return new LazyL10N(function() use ($app, $lang, $locale) { |
|
130 | 130 | $app = \OC_App::cleanAppId($app); |
131 | 131 | if ($lang !== null) { |
132 | 132 | $lang = str_replace(['\0', '/', '\\', '..'], '', $lang); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @link https://github.com/owncloud/core/issues/21955 |
192 | 192 | */ |
193 | 193 | if ($this->config->getSystemValue('installed', false)) { |
194 | - $userId = !is_null($this->userSession->getUser()) ? $this->userSession->getUser()->getUID() : null; |
|
194 | + $userId = !is_null($this->userSession->getUser()) ? $this->userSession->getUser()->getUID() : null; |
|
195 | 195 | if (!is_null($userId)) { |
196 | 196 | $userLang = $this->config->getUserValue($userId, 'core', 'lang', null); |
197 | 197 | } else { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | if ($this->config->getSystemValue('installed', false)) { |
281 | - $userId = null !== $this->userSession->getUser() ? $this->userSession->getUser()->getUID() : null; |
|
281 | + $userId = null !== $this->userSession->getUser() ? $this->userSession->getUser()->getUID() : null; |
|
282 | 282 | $userLocale = null; |
283 | 283 | if (null !== $userId) { |
284 | 284 | $userLocale = $this->config->getUserValue($userId, 'core', 'locale', null); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | // merge with translations from theme |
360 | 360 | $theme = $this->config->getSystemValue('theme'); |
361 | 361 | if (!empty($theme)) { |
362 | - $themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot)); |
|
362 | + $themeDir = $this->serverRoot.'/themes/'.$theme.substr($dir, strlen($this->serverRoot)); |
|
363 | 363 | |
364 | 364 | if (is_dir($themeDir)) { |
365 | 365 | $files = scandir($themeDir); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | return $this->availableLocales; |
386 | 386 | } |
387 | 387 | |
388 | - $localeData = file_get_contents(\OC::$SERVERROOT . '/resources/locales.json'); |
|
388 | + $localeData = file_get_contents(\OC::$SERVERROOT.'/resources/locales.json'); |
|
389 | 389 | $this->availableLocales = \json_decode($localeData, true); |
390 | 390 | |
391 | 391 | return $this->availableLocales; |
@@ -554,11 +554,11 @@ discard block |
||
554 | 554 | $languageFiles = []; |
555 | 555 | |
556 | 556 | $i18nDir = $this->findL10nDir($app); |
557 | - $transFile = strip_tags($i18nDir) . strip_tags($lang) . '.json'; |
|
557 | + $transFile = strip_tags($i18nDir).strip_tags($lang).'.json'; |
|
558 | 558 | |
559 | - if (($this->isSubDirectory($transFile, $this->serverRoot . '/core/l10n/') |
|
560 | - || $this->isSubDirectory($transFile, $this->serverRoot . '/lib/l10n/') |
|
561 | - || $this->isSubDirectory($transFile, \OC_App::getAppPath($app) . '/l10n/')) |
|
559 | + if (($this->isSubDirectory($transFile, $this->serverRoot.'/core/l10n/') |
|
560 | + || $this->isSubDirectory($transFile, $this->serverRoot.'/lib/l10n/') |
|
561 | + || $this->isSubDirectory($transFile, \OC_App::getAppPath($app).'/l10n/')) |
|
562 | 562 | && file_exists($transFile) |
563 | 563 | ) { |
564 | 564 | // load the translations file |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | // merge with translations from theme |
569 | 569 | $theme = $this->config->getSystemValue('theme'); |
570 | 570 | if (!empty($theme)) { |
571 | - $transFile = $this->serverRoot . '/themes/' . $theme . substr($transFile, strlen($this->serverRoot)); |
|
571 | + $transFile = $this->serverRoot.'/themes/'.$theme.substr($transFile, strlen($this->serverRoot)); |
|
572 | 572 | if (file_exists($transFile)) { |
573 | 573 | $languageFiles[] = $transFile; |
574 | 574 | } |
@@ -585,14 +585,14 @@ discard block |
||
585 | 585 | */ |
586 | 586 | protected function findL10nDir($app = null) { |
587 | 587 | if (in_array($app, ['core', 'lib'])) { |
588 | - if (file_exists($this->serverRoot . '/' . $app . '/l10n/')) { |
|
589 | - return $this->serverRoot . '/' . $app . '/l10n/'; |
|
588 | + if (file_exists($this->serverRoot.'/'.$app.'/l10n/')) { |
|
589 | + return $this->serverRoot.'/'.$app.'/l10n/'; |
|
590 | 590 | } |
591 | 591 | } elseif ($app && \OC_App::getAppPath($app) !== false) { |
592 | 592 | // Check if the app is in the app folder |
593 | - return \OC_App::getAppPath($app) . '/l10n/'; |
|
593 | + return \OC_App::getAppPath($app).'/l10n/'; |
|
594 | 594 | } |
595 | - return $this->serverRoot . '/core/l10n/'; |
|
595 | + return $this->serverRoot.'/core/l10n/'; |
|
596 | 596 | } |
597 | 597 | |
598 | 598 | /** |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | ksort($commonLanguages); |
652 | 652 | |
653 | 653 | // sort now by displayed language not the iso-code |
654 | - usort($otherLanguages, function ($a, $b) { |
|
654 | + usort($otherLanguages, function($a, $b) { |
|
655 | 655 | if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
656 | 656 | // If a doesn't have a name, but b does, list b before a |
657 | 657 | return 1; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function getPath(string $user, string $path): string { |
96 | 96 | $node = $this->rootFolder->getUserFolder($user)->get($path); |
97 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
97 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | try { |
127 | 127 | $lockingProvider->acquireLock($path, $type); |
128 | - $this->config->setAppValue('testing', 'locking_' . $path, (string)$type); |
|
128 | + $this->config->setAppValue('testing', 'locking_'.$path, (string) $type); |
|
129 | 129 | return new DataResponse(); |
130 | 130 | } catch (LockedException $e) { |
131 | 131 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | try { |
150 | 150 | $lockingProvider->changeLock($path, $type); |
151 | - $this->config->setAppValue('testing', 'locking_' . $path, (string)$type); |
|
151 | + $this->config->setAppValue('testing', 'locking_'.$path, (string) $type); |
|
152 | 152 | return new DataResponse(); |
153 | 153 | } catch (LockedException $e) { |
154 | 154 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | try { |
173 | 173 | $lockingProvider->releaseLock($path, $type); |
174 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
174 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
175 | 175 | return new DataResponse(); |
176 | 176 | } catch (LockedException $e) { |
177 | 177 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | if (strpos($lock, 'locking_') === 0) { |
207 | 207 | $path = substr($lock, strlen('locking_')); |
208 | 208 | |
209 | - if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
210 | - $lockingProvider->releaseLock($path, (int)$this->config->getAppValue('testing', $lock)); |
|
211 | - } elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
212 | - $lockingProvider->releaseLock($path, (int)$this->config->getAppValue('testing', $lock)); |
|
209 | + if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
210 | + $lockingProvider->releaseLock($path, (int) $this->config->getAppValue('testing', $lock)); |
|
211 | + } elseif ($type === ILockingProvider::LOCK_SHARED && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
212 | + $lockingProvider->releaseLock($path, (int) $this->config->getAppValue('testing', $lock)); |
|
213 | 213 | } else { |
214 | - $lockingProvider->releaseLock($path, (int)$this->config->getAppValue('testing', $lock)); |
|
214 | + $lockingProvider->releaseLock($path, (int) $this->config->getAppValue('testing', $lock)); |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $sectionID = $section->getID(); |
133 | 133 | |
134 | 134 | if (!$this->isKnownDuplicateSectionId($sectionID) && isset($this->sections[$type][$sectionID])) { |
135 | - $e = new \InvalidArgumentException('Section with the same ID already registered: ' . $sectionID . ', class: ' . $class); |
|
135 | + $e = new \InvalidArgumentException('Section with the same ID already registered: '.$sectionID.', class: '.$class); |
|
136 | 136 | $this->log->info($e->getMessage(), ['exception' => $e]); |
137 | 137 | continue; |
138 | 138 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | if (!$setting instanceof ISettings) { |
201 | - $e = new \InvalidArgumentException('Invalid settings setting registered (' . $class . ')'); |
|
201 | + $e = new \InvalidArgumentException('Invalid settings setting registered ('.$class.')'); |
|
202 | 202 | $this->log->info($e->getMessage(), ['exception' => $e]); |
203 | 203 | continue; |
204 | 204 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | public function getAdminSettings($section, bool $subAdminOnly = false): array { |
251 | 251 | if ($subAdminOnly) { |
252 | - $subAdminSettingsFilter = function (ISettings $settings) { |
|
252 | + $subAdminSettingsFilter = function(ISettings $settings) { |
|
253 | 253 | return $settings instanceof ISubAdminSettings; |
254 | 254 | }; |
255 | 255 | $appSettings = $this->getSettings('admin', $section, $subAdminSettingsFilter); |
@@ -340,12 +340,12 @@ discard block |
||
340 | 340 | } else { |
341 | 341 | $authorizedSettingsClasses = $this->mapper->findAllClassesForUser($user); |
342 | 342 | if ($this->subAdmin->isSubAdmin($user)) { |
343 | - $authorizedGroupFilter = function (ISettings $settings) use ($authorizedSettingsClasses) { |
|
343 | + $authorizedGroupFilter = function(ISettings $settings) use ($authorizedSettingsClasses) { |
|
344 | 344 | return $settings instanceof ISubAdminSettings |
345 | 345 | || in_array(get_class($settings), $authorizedSettingsClasses) === true; |
346 | 346 | }; |
347 | 347 | } else { |
348 | - $authorizedGroupFilter = function (ISettings $settings) use ($authorizedSettingsClasses) { |
|
348 | + $authorizedGroupFilter = function(ISettings $settings) use ($authorizedSettingsClasses) { |
|
349 | 349 | return in_array(get_class($settings), $authorizedSettingsClasses) === true; |
350 | 350 | }; |
351 | 351 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | // Remember and return |
80 | 80 | return $this->hasBackend = true; |
81 | 81 | } catch (Throwable $e) { |
82 | - $this->logger->error("Talk backend {class} could not be loaded: " . $e->getMessage(), [ |
|
82 | + $this->logger->error("Talk backend {class} could not be loaded: ".$e->getMessage(), [ |
|
83 | 83 | 'class' => $backendRegistration->getService(), |
84 | 84 | 'exception' => $e, |
85 | 85 | ]); |