@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'www.edri.org', |
| 127 | 127 | ]; |
| 128 | 128 | |
| 129 | - foreach($siteArray as $site) { |
|
| 129 | + foreach ($siteArray as $site) { |
|
| 130 | 130 | if ($this->isSiteReachable($site)) { |
| 131 | 131 | return true; |
| 132 | 132 | } |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | * @return bool |
| 140 | 140 | */ |
| 141 | 141 | private function isSiteReachable($sitename) { |
| 142 | - $httpSiteName = 'http://' . $sitename . '/'; |
|
| 143 | - $httpsSiteName = 'https://' . $sitename . '/'; |
|
| 142 | + $httpSiteName = 'http://'.$sitename.'/'; |
|
| 143 | + $httpsSiteName = 'https://'.$sitename.'/'; |
|
| 144 | 144 | |
| 145 | 145 | try { |
| 146 | 146 | $client = $this->clientService->newClient(); |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | * @return bool |
| 168 | 168 | */ |
| 169 | 169 | private function isUrandomAvailable() { |
| 170 | - if(@file_exists('/dev/urandom')) { |
|
| 170 | + if (@file_exists('/dev/urandom')) { |
|
| 171 | 171 | $file = fopen('/dev/urandom', 'rb'); |
| 172 | - if($file) { |
|
| 172 | + if ($file) { |
|
| 173 | 173 | fclose($file); |
| 174 | 174 | return true; |
| 175 | 175 | } |
@@ -200,40 +200,40 @@ discard block |
||
| 200 | 200 | // Don't run check when: |
| 201 | 201 | // 1. Server has `has_internet_connection` set to false |
| 202 | 202 | // 2. AppStore AND S2S is disabled |
| 203 | - if(!$this->config->getSystemValue('has_internet_connection', true)) { |
|
| 203 | + if (!$this->config->getSystemValue('has_internet_connection', true)) { |
|
| 204 | 204 | return ''; |
| 205 | 205 | } |
| 206 | - if(!$this->config->getSystemValue('appstoreenabled', true) |
|
| 206 | + if (!$this->config->getSystemValue('appstoreenabled', true) |
|
| 207 | 207 | && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' |
| 208 | 208 | && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { |
| 209 | 209 | return ''; |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $versionString = $this->getCurlVersion(); |
| 213 | - if(isset($versionString['ssl_version'])) { |
|
| 213 | + if (isset($versionString['ssl_version'])) { |
|
| 214 | 214 | $versionString = $versionString['ssl_version']; |
| 215 | 215 | } else { |
| 216 | 216 | return ''; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
| 220 | - if(!$this->config->getSystemValue('appstoreenabled', true)) { |
|
| 221 | - $features = (string)$this->l10n->t('Federated Cloud Sharing'); |
|
| 219 | + $features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
| 220 | + if (!$this->config->getSystemValue('appstoreenabled', true)) { |
|
| 221 | + $features = (string) $this->l10n->t('Federated Cloud Sharing'); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | // Check if at least OpenSSL after 1.01d or 1.0.2b |
| 225 | - if(strpos($versionString, 'OpenSSL/') === 0) { |
|
| 225 | + if (strpos($versionString, 'OpenSSL/') === 0) { |
|
| 226 | 226 | $majorVersion = substr($versionString, 8, 5); |
| 227 | 227 | $patchRelease = substr($versionString, 13, 6); |
| 228 | 228 | |
| 229 | - if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
| 229 | + if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
| 230 | 230 | ($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) { |
| 231 | 231 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['OpenSSL', $versionString, $features]); |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Check if NSS and perform heuristic check |
| 236 | - if(strpos($versionString, 'NSS/') === 0) { |
|
| 236 | + if (strpos($versionString, 'NSS/') === 0) { |
|
| 237 | 237 | try { |
| 238 | 238 | $firstClient = $this->clientService->newClient(); |
| 239 | 239 | $firstClient->get('https://nextcloud.com/'); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $secondClient = $this->clientService->newClient(); |
| 242 | 242 | $secondClient->get('https://nextcloud.com/'); |
| 243 | 243 | } catch (ClientException $e) { |
| 244 | - if($e->getResponse()->getStatusCode() === 400) { |
|
| 244 | + if ($e->getResponse()->getStatusCode() === 400) { |
|
| 245 | 245 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['NSS', $versionString, $features]); |
| 246 | 246 | } |
| 247 | 247 | } |
@@ -336,13 +336,13 @@ discard block |
||
| 336 | 336 | * @return DataResponse |
| 337 | 337 | */ |
| 338 | 338 | public function getFailedIntegrityCheckFiles() { |
| 339 | - if(!$this->checker->isCodeCheckEnforced()) { |
|
| 339 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
| 340 | 340 | return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | $completeResults = $this->checker->getResults(); |
| 344 | 344 | |
| 345 | - if(!empty($completeResults)) { |
|
| 345 | + if (!empty($completeResults)) { |
|
| 346 | 346 | $formattedTextResponse = 'Technical information |
| 347 | 347 | ===================== |
| 348 | 348 | The following list covers which files have failed the integrity check. Please read |
@@ -352,12 +352,12 @@ discard block |
||
| 352 | 352 | Results |
| 353 | 353 | ======= |
| 354 | 354 | '; |
| 355 | - foreach($completeResults as $context => $contextResult) { |
|
| 355 | + foreach ($completeResults as $context => $contextResult) { |
|
| 356 | 356 | $formattedTextResponse .= "- $context\n"; |
| 357 | 357 | |
| 358 | - foreach($contextResult as $category => $result) { |
|
| 358 | + foreach ($contextResult as $category => $result) { |
|
| 359 | 359 | $formattedTextResponse .= "\t- $category\n"; |
| 360 | - if($category !== 'EXCEPTION') { |
|
| 360 | + if ($category !== 'EXCEPTION') { |
|
| 361 | 361 | foreach ($result as $key => $results) { |
| 362 | 362 | $formattedTextResponse .= "\t\t- $key\n"; |
| 363 | 363 | } |
@@ -398,27 +398,27 @@ discard block |
||
| 398 | 398 | protected function isOpcacheProperlySetup() { |
| 399 | 399 | $iniWrapper = new IniGetWrapper(); |
| 400 | 400 | |
| 401 | - if(!$iniWrapper->getBool('opcache.enable')) { |
|
| 401 | + if (!$iniWrapper->getBool('opcache.enable')) { |
|
| 402 | 402 | return false; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | - if(!$iniWrapper->getBool('opcache.save_comments')) { |
|
| 405 | + if (!$iniWrapper->getBool('opcache.save_comments')) { |
|
| 406 | 406 | return false; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - if(!$iniWrapper->getBool('opcache.enable_cli')) { |
|
| 409 | + if (!$iniWrapper->getBool('opcache.enable_cli')) { |
|
| 410 | 410 | return false; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
| 413 | + if ($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
| 414 | 414 | return false; |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
| 417 | + if ($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
| 418 | 418 | return false; |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
| 421 | + if ($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
| 422 | 422 | return false; |
| 423 | 423 | } |
| 424 | 424 | |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | protected function getSuggestedOverwriteCliURL(): string { |
| 495 | 495 | $suggestedOverwriteCliUrl = ''; |
| 496 | 496 | if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
| 497 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
| 497 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol().'://'.$this->request->getInsecureServerHost().\OC::$WEBROOT; |
|
| 498 | 498 | if (!$this->config->getSystemValue('config_is_read_only', false)) { |
| 499 | 499 | // Set the overwrite URL when it was not set yet. |
| 500 | 500 | $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | return [ |
| 510 | 510 | 'diffInSeconds' => time() - $lastCronRun, |
| 511 | 511 | 'relativeTime' => $this->dateTimeFormatter->formatTimeSpan($lastCronRun), |
| 512 | - 'backgroundJobsUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'server']) . '#backgroundjobs', |
|
| 512 | + 'backgroundJobsUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'server']).'#backgroundjobs', |
|
| 513 | 513 | ]; |
| 514 | 514 | } |
| 515 | 515 | |
@@ -568,10 +568,10 @@ discard block |
||
| 568 | 568 | |
| 569 | 569 | foreach ($appsDir as $fileInfo) { |
| 570 | 570 | if ($fileInfo->isDir() && !$fileInfo->isDot()) { |
| 571 | - $absAppPath = $appsPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename(); |
|
| 571 | + $absAppPath = $appsPath.DIRECTORY_SEPARATOR.$fileInfo->getFilename(); |
|
| 572 | 572 | $appDirUser = posix_getpwuid(fileowner($absAppPath)); |
| 573 | 573 | if ($appDirUser !== $currentUser) { |
| 574 | - $appDirsWithDifferentOwner[] = $absAppPath . DIRECTORY_SEPARATOR . $fileInfo->getFilename(); |
|
| 574 | + $appDirsWithDifferentOwner[] = $absAppPath.DIRECTORY_SEPARATOR.$fileInfo->getFilename(); |
|
| 575 | 575 | } |
| 576 | 576 | } |
| 577 | 577 | } |