@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | 'www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org' |
137 | 137 | ]); |
138 | 138 | |
139 | - foreach($siteArray as $site) { |
|
139 | + foreach ($siteArray as $site) { |
|
140 | 140 | if ($this->isSiteReachable($site)) { |
141 | 141 | return true; |
142 | 142 | } |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | * @return bool |
150 | 150 | */ |
151 | 151 | private function isSiteReachable($sitename) { |
152 | - $httpSiteName = 'http://' . $sitename . '/'; |
|
153 | - $httpsSiteName = 'https://' . $sitename . '/'; |
|
152 | + $httpSiteName = 'http://'.$sitename.'/'; |
|
153 | + $httpsSiteName = 'https://'.$sitename.'/'; |
|
154 | 154 | |
155 | 155 | try { |
156 | 156 | $client = $this->clientService->newClient(); |
@@ -207,40 +207,40 @@ discard block |
||
207 | 207 | // Don't run check when: |
208 | 208 | // 1. Server has `has_internet_connection` set to false |
209 | 209 | // 2. AppStore AND S2S is disabled |
210 | - if(!$this->config->getSystemValue('has_internet_connection', true)) { |
|
210 | + if (!$this->config->getSystemValue('has_internet_connection', true)) { |
|
211 | 211 | return ''; |
212 | 212 | } |
213 | - if(!$this->config->getSystemValue('appstoreenabled', true) |
|
213 | + if (!$this->config->getSystemValue('appstoreenabled', true) |
|
214 | 214 | && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' |
215 | 215 | && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { |
216 | 216 | return ''; |
217 | 217 | } |
218 | 218 | |
219 | 219 | $versionString = $this->getCurlVersion(); |
220 | - if(isset($versionString['ssl_version'])) { |
|
220 | + if (isset($versionString['ssl_version'])) { |
|
221 | 221 | $versionString = $versionString['ssl_version']; |
222 | 222 | } else { |
223 | 223 | return ''; |
224 | 224 | } |
225 | 225 | |
226 | - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
227 | - if(!$this->config->getSystemValue('appstoreenabled', true)) { |
|
228 | - $features = (string)$this->l10n->t('Federated Cloud Sharing'); |
|
226 | + $features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
227 | + if (!$this->config->getSystemValue('appstoreenabled', true)) { |
|
228 | + $features = (string) $this->l10n->t('Federated Cloud Sharing'); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | // Check if at least OpenSSL after 1.01d or 1.0.2b |
232 | - if(strpos($versionString, 'OpenSSL/') === 0) { |
|
232 | + if (strpos($versionString, 'OpenSSL/') === 0) { |
|
233 | 233 | $majorVersion = substr($versionString, 8, 5); |
234 | 234 | $patchRelease = substr($versionString, 13, 6); |
235 | 235 | |
236 | - if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
236 | + if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
237 | 237 | ($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) { |
238 | 238 | return $this->l10n->t('cURL is using an outdated %1$s version (%2$s). Please update your operating system or features such as %3$s will not work reliably.', ['OpenSSL', $versionString, $features]); |
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
242 | 242 | // Check if NSS and perform heuristic check |
243 | - if(strpos($versionString, 'NSS/') === 0) { |
|
243 | + if (strpos($versionString, 'NSS/') === 0) { |
|
244 | 244 | try { |
245 | 245 | $firstClient = $this->clientService->newClient(); |
246 | 246 | $firstClient->get('https://nextcloud.com/'); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $secondClient = $this->clientService->newClient(); |
249 | 249 | $secondClient->get('https://nextcloud.com/'); |
250 | 250 | } catch (ClientException $e) { |
251 | - if($e->getResponse()->getStatusCode() === 400) { |
|
251 | + if ($e->getResponse()->getStatusCode() === 400) { |
|
252 | 252 | return $this->l10n->t('cURL is using an outdated %1$s version (%2$s). Please update your operating system or features such as %3$s will not work reliably.', ['NSS', $versionString, $features]); |
253 | 253 | } |
254 | 254 | } |
@@ -347,13 +347,13 @@ discard block |
||
347 | 347 | * @return DataResponse |
348 | 348 | */ |
349 | 349 | public function getFailedIntegrityCheckFiles() { |
350 | - if(!$this->checker->isCodeCheckEnforced()) { |
|
350 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
351 | 351 | return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); |
352 | 352 | } |
353 | 353 | |
354 | 354 | $completeResults = $this->checker->getResults(); |
355 | 355 | |
356 | - if(!empty($completeResults)) { |
|
356 | + if (!empty($completeResults)) { |
|
357 | 357 | $formattedTextResponse = 'Technical information |
358 | 358 | ===================== |
359 | 359 | The following list covers which files have failed the integrity check. Please read |
@@ -363,12 +363,12 @@ discard block |
||
363 | 363 | Results |
364 | 364 | ======= |
365 | 365 | '; |
366 | - foreach($completeResults as $context => $contextResult) { |
|
366 | + foreach ($completeResults as $context => $contextResult) { |
|
367 | 367 | $formattedTextResponse .= "- $context\n"; |
368 | 368 | |
369 | - foreach($contextResult as $category => $result) { |
|
369 | + foreach ($contextResult as $category => $result) { |
|
370 | 370 | $formattedTextResponse .= "\t- $category\n"; |
371 | - if($category !== 'EXCEPTION') { |
|
371 | + if ($category !== 'EXCEPTION') { |
|
372 | 372 | foreach ($result as $key => $results) { |
373 | 373 | $formattedTextResponse .= "\t\t- $key\n"; |
374 | 374 | } |
@@ -409,27 +409,27 @@ discard block |
||
409 | 409 | protected function isOpcacheProperlySetup() { |
410 | 410 | $iniWrapper = new IniGetWrapper(); |
411 | 411 | |
412 | - if(!$iniWrapper->getBool('opcache.enable')) { |
|
412 | + if (!$iniWrapper->getBool('opcache.enable')) { |
|
413 | 413 | return false; |
414 | 414 | } |
415 | 415 | |
416 | - if(!$iniWrapper->getBool('opcache.save_comments')) { |
|
416 | + if (!$iniWrapper->getBool('opcache.save_comments')) { |
|
417 | 417 | return false; |
418 | 418 | } |
419 | 419 | |
420 | - if(!$iniWrapper->getBool('opcache.enable_cli')) { |
|
420 | + if (!$iniWrapper->getBool('opcache.enable_cli')) { |
|
421 | 421 | return false; |
422 | 422 | } |
423 | 423 | |
424 | - if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
424 | + if ($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
425 | 425 | return false; |
426 | 426 | } |
427 | 427 | |
428 | - if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
428 | + if ($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
429 | 429 | return false; |
430 | 430 | } |
431 | 431 | |
432 | - if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
432 | + if ($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
433 | 433 | return false; |
434 | 434 | } |
435 | 435 | |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | protected function getSuggestedOverwriteCliURL(): string { |
487 | 487 | $suggestedOverwriteCliUrl = ''; |
488 | 488 | if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
489 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
489 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol().'://'.$this->request->getInsecureServerHost().\OC::$WEBROOT; |
|
490 | 490 | if (!$this->config->getSystemValue('config_is_read_only', false)) { |
491 | 491 | // Set the overwrite URL when it was not set yet. |
492 | 492 | $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | return [ |
502 | 502 | 'diffInSeconds' => time() - $lastCronRun, |
503 | 503 | 'relativeTime' => $this->dateTimeFormatter->formatTimeSpan($lastCronRun), |
504 | - 'backgroundJobsUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'server']) . '#backgroundjobs', |
|
504 | + 'backgroundJobsUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'server']).'#backgroundjobs', |
|
505 | 505 | ]; |
506 | 506 | } |
507 | 507 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | |
560 | 560 | foreach ($appsDir as $fileInfo) { |
561 | 561 | if ($fileInfo->isDir() && !$fileInfo->isDot()) { |
562 | - $absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename(); |
|
562 | + $absAppPath = $appsPath.DIRECTORY_SEPARATOR.$fileInfo->getFilename(); |
|
563 | 563 | $appDirUser = fileowner($absAppPath); |
564 | 564 | if ($appDirUser !== $currentUser) { |
565 | 565 | $appDirsWithDifferentOwner[] = $absAppPath; |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | $isAutoIncrement = $column->getAutoincrement(); |
621 | 621 | $isAutoIncrementOnSqlite = $isSqlite && $isAutoIncrement; |
622 | 622 | if ($column->getType()->getName() !== Type::BIGINT && !$isAutoIncrementOnSqlite) { |
623 | - $pendingColumns[] = $tableName . '.' . $columnName; |
|
623 | + $pendingColumns[] = $tableName.'.'.$columnName; |
|
624 | 624 | } |
625 | 625 | } |
626 | 626 | } |
@@ -646,12 +646,12 @@ discard block |
||
646 | 646 | |
647 | 647 | $tempPath = sys_get_temp_dir(); |
648 | 648 | if (!is_dir($tempPath)) { |
649 | - $this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. value: ' . $tempPath); |
|
649 | + $this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. value: '.$tempPath); |
|
650 | 650 | return false; |
651 | 651 | } |
652 | 652 | $freeSpaceInTemp = disk_free_space($tempPath); |
653 | 653 | if ($freeSpaceInTemp === false) { |
654 | - $this->logger->error('Error while checking the available disk space of temporary PHP path - no free disk space returned. temporary path: ' . $tempPath); |
|
654 | + $this->logger->error('Error while checking the available disk space of temporary PHP path - no free disk space returned. temporary path: '.$tempPath); |
|
655 | 655 | return false; |
656 | 656 | } |
657 | 657 | |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | return true; |
661 | 661 | } |
662 | 662 | |
663 | - $this->logger->warning('Checking the available space in the temporary path resulted in ' . round($freeSpaceInTempInGB, 1) . ' GB instead of the recommended 50GB. Path: ' . $tempPath); |
|
663 | + $this->logger->warning('Checking the available space in the temporary path resulted in '.round($freeSpaceInTempInGB, 1).' GB instead of the recommended 50GB. Path: '.$tempPath); |
|
664 | 664 | return false; |
665 | 665 | } |
666 | 666 |