@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | 'www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org' |
| 133 | 133 | ]); |
| 134 | 134 | |
| 135 | - foreach($siteArray as $site) { |
|
| 135 | + foreach ($siteArray as $site) { |
|
| 136 | 136 | if ($this->isSiteReachable($site)) { |
| 137 | 137 | return false; |
| 138 | 138 | } |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | * @return bool |
| 146 | 146 | */ |
| 147 | 147 | private function isSiteReachable($sitename) { |
| 148 | - $httpSiteName = 'http://' . $sitename . '/'; |
|
| 149 | - $httpsSiteName = 'https://' . $sitename . '/'; |
|
| 148 | + $httpSiteName = 'http://'.$sitename.'/'; |
|
| 149 | + $httpsSiteName = 'https://'.$sitename.'/'; |
|
| 150 | 150 | |
| 151 | 151 | try { |
| 152 | 152 | $client = $this->clientService->newClient(); |
@@ -203,40 +203,40 @@ discard block |
||
| 203 | 203 | // Don't run check when: |
| 204 | 204 | // 1. Server has `has_internet_connection` set to false |
| 205 | 205 | // 2. AppStore AND S2S is disabled |
| 206 | - if(!$this->config->getSystemValue('has_internet_connection', true)) { |
|
| 206 | + if (!$this->config->getSystemValue('has_internet_connection', true)) { |
|
| 207 | 207 | return ''; |
| 208 | 208 | } |
| 209 | - if(!$this->config->getSystemValue('appstoreenabled', true) |
|
| 209 | + if (!$this->config->getSystemValue('appstoreenabled', true) |
|
| 210 | 210 | && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' |
| 211 | 211 | && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { |
| 212 | 212 | return ''; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | $versionString = $this->getCurlVersion(); |
| 216 | - if(isset($versionString['ssl_version'])) { |
|
| 216 | + if (isset($versionString['ssl_version'])) { |
|
| 217 | 217 | $versionString = $versionString['ssl_version']; |
| 218 | 218 | } else { |
| 219 | 219 | return ''; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
| 223 | - if(!$this->config->getSystemValue('appstoreenabled', true)) { |
|
| 224 | - $features = (string)$this->l10n->t('Federated Cloud Sharing'); |
|
| 222 | + $features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
| 223 | + if (!$this->config->getSystemValue('appstoreenabled', true)) { |
|
| 224 | + $features = (string) $this->l10n->t('Federated Cloud Sharing'); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // Check if at least OpenSSL after 1.01d or 1.0.2b |
| 228 | - if(strpos($versionString, 'OpenSSL/') === 0) { |
|
| 228 | + if (strpos($versionString, 'OpenSSL/') === 0) { |
|
| 229 | 229 | $majorVersion = substr($versionString, 8, 5); |
| 230 | 230 | $patchRelease = substr($versionString, 13, 6); |
| 231 | 231 | |
| 232 | - if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
| 232 | + if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
| 233 | 233 | ($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) { |
| 234 | 234 | 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]); |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | // Check if NSS and perform heuristic check |
| 239 | - if(strpos($versionString, 'NSS/') === 0) { |
|
| 239 | + if (strpos($versionString, 'NSS/') === 0) { |
|
| 240 | 240 | try { |
| 241 | 241 | $firstClient = $this->clientService->newClient(); |
| 242 | 242 | $firstClient->get('https://nextcloud.com/'); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $secondClient = $this->clientService->newClient(); |
| 245 | 245 | $secondClient->get('https://nextcloud.com/'); |
| 246 | 246 | } catch (ClientException $e) { |
| 247 | - if($e->getResponse()->getStatusCode() === 400) { |
|
| 247 | + if ($e->getResponse()->getStatusCode() === 400) { |
|
| 248 | 248 | 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]); |
| 249 | 249 | } |
| 250 | 250 | } |
@@ -343,13 +343,13 @@ discard block |
||
| 343 | 343 | * @return DataResponse |
| 344 | 344 | */ |
| 345 | 345 | public function getFailedIntegrityCheckFiles() { |
| 346 | - if(!$this->checker->isCodeCheckEnforced()) { |
|
| 346 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
| 347 | 347 | return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | $completeResults = $this->checker->getResults(); |
| 351 | 351 | |
| 352 | - if(!empty($completeResults)) { |
|
| 352 | + if (!empty($completeResults)) { |
|
| 353 | 353 | $formattedTextResponse = 'Technical information |
| 354 | 354 | ===================== |
| 355 | 355 | The following list covers which files have failed the integrity check. Please read |
@@ -359,12 +359,12 @@ discard block |
||
| 359 | 359 | Results |
| 360 | 360 | ======= |
| 361 | 361 | '; |
| 362 | - foreach($completeResults as $context => $contextResult) { |
|
| 362 | + foreach ($completeResults as $context => $contextResult) { |
|
| 363 | 363 | $formattedTextResponse .= "- $context\n"; |
| 364 | 364 | |
| 365 | - foreach($contextResult as $category => $result) { |
|
| 365 | + foreach ($contextResult as $category => $result) { |
|
| 366 | 366 | $formattedTextResponse .= "\t- $category\n"; |
| 367 | - if($category !== 'EXCEPTION') { |
|
| 367 | + if ($category !== 'EXCEPTION') { |
|
| 368 | 368 | foreach ($result as $key => $results) { |
| 369 | 369 | $formattedTextResponse .= "\t\t- $key\n"; |
| 370 | 370 | } |
@@ -405,23 +405,23 @@ discard block |
||
| 405 | 405 | protected function isOpcacheProperlySetup() { |
| 406 | 406 | $iniWrapper = new IniGetWrapper(); |
| 407 | 407 | |
| 408 | - if(!$iniWrapper->getBool('opcache.enable')) { |
|
| 408 | + if (!$iniWrapper->getBool('opcache.enable')) { |
|
| 409 | 409 | return false; |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | - if(!$iniWrapper->getBool('opcache.save_comments')) { |
|
| 412 | + if (!$iniWrapper->getBool('opcache.save_comments')) { |
|
| 413 | 413 | return false; |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | - if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
| 416 | + if ($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
| 417 | 417 | return false; |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | - if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
| 420 | + if ($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
| 421 | 421 | return false; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
| 424 | + if ($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
| 425 | 425 | return false; |
| 426 | 426 | } |
| 427 | 427 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | protected function getSuggestedOverwriteCliURL(): string { |
| 479 | 479 | $suggestedOverwriteCliUrl = ''; |
| 480 | 480 | if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
| 481 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
| 481 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol().'://'.$this->request->getInsecureServerHost().\OC::$WEBROOT; |
|
| 482 | 482 | if (!$this->config->getSystemValue('config_is_read_only', false)) { |
| 483 | 483 | // Set the overwrite URL when it was not set yet. |
| 484 | 484 | $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | return [ |
| 494 | 494 | 'diffInSeconds' => time() - $lastCronRun, |
| 495 | 495 | 'relativeTime' => $this->dateTimeFormatter->formatTimeSpan($lastCronRun), |
| 496 | - 'backgroundJobsUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'server']) . '#backgroundjobs', |
|
| 496 | + 'backgroundJobsUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'server']).'#backgroundjobs', |
|
| 497 | 497 | ]; |
| 498 | 498 | } |
| 499 | 499 | |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | |
| 552 | 552 | foreach ($appsDir as $fileInfo) { |
| 553 | 553 | if ($fileInfo->isDir() && !$fileInfo->isDot()) { |
| 554 | - $absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename(); |
|
| 554 | + $absAppPath = $appsPath.DIRECTORY_SEPARATOR.$fileInfo->getFilename(); |
|
| 555 | 555 | $appDirUser = fileowner($absAppPath); |
| 556 | 556 | if ($appDirUser !== $currentUser) { |
| 557 | 557 | $appDirsWithDifferentOwner[] = $absAppPath; |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | $isAutoIncrement = $column->getAutoincrement(); |
| 613 | 613 | $isAutoIncrementOnSqlite = $isSqlite && $isAutoIncrement; |
| 614 | 614 | if ($column->getType()->getName() !== Type::BIGINT && !$isAutoIncrementOnSqlite) { |
| 615 | - $pendingColumns[] = $tableName . '.' . $columnName; |
|
| 615 | + $pendingColumns[] = $tableName.'.'.$columnName; |
|
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | } |
@@ -638,12 +638,12 @@ discard block |
||
| 638 | 638 | |
| 639 | 639 | $tempPath = sys_get_temp_dir(); |
| 640 | 640 | if (!is_dir($tempPath)) { |
| 641 | - $this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. value: ' . $tempPath); |
|
| 641 | + $this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. value: '.$tempPath); |
|
| 642 | 642 | return false; |
| 643 | 643 | } |
| 644 | 644 | $freeSpaceInTemp = disk_free_space($tempPath); |
| 645 | 645 | if ($freeSpaceInTemp === false) { |
| 646 | - $this->logger->error('Error while checking the available disk space of temporary PHP path - no free disk space returned. temporary path: ' . $tempPath); |
|
| 646 | + $this->logger->error('Error while checking the available disk space of temporary PHP path - no free disk space returned. temporary path: '.$tempPath); |
|
| 647 | 647 | return false; |
| 648 | 648 | } |
| 649 | 649 | |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | return true; |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | - $this->logger->warning('Checking the available space in the temporary path resulted in ' . round($freeSpaceInTempInGB, 1) . ' GB instead of the recommended 50GB. Path: ' . $tempPath); |
|
| 655 | + $this->logger->warning('Checking the available space in the temporary path resulted in '.round($freeSpaceInTempInGB, 1).' GB instead of the recommended 50GB. Path: '.$tempPath); |
|
| 656 | 656 | return false; |
| 657 | 657 | } |
| 658 | 658 | |