Completed
Push — master ( a97b9b...b19735 )
by Blizzz
21:21
created
settings/Controller/CheckSetupController.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 						'www.edri.org',
110 110
 			];
111 111
 
112
-		foreach($siteArray as $site) {
112
+		foreach ($siteArray as $site) {
113 113
 			if ($this->isSiteReachable($site)) {
114 114
 				return true;
115 115
 			}
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	* @return bool
123 123
 	*/
124 124
 	private function isSiteReachable($sitename) {
125
-		$httpSiteName = 'http://' . $sitename . '/';
126
-		$httpsSiteName = 'https://' . $sitename . '/';
125
+		$httpSiteName = 'http://'.$sitename.'/';
126
+		$httpsSiteName = 'https://'.$sitename.'/';
127 127
 
128 128
 		try {
129 129
 			$client = $this->clientService->newClient();
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 	 * @return bool
151 151
 	 */
152 152
 	private function isUrandomAvailable() {
153
-		if(@file_exists('/dev/urandom')) {
153
+		if (@file_exists('/dev/urandom')) {
154 154
 			$file = fopen('/dev/urandom', 'rb');
155
-			if($file) {
155
+			if ($file) {
156 156
 				fclose($file);
157 157
 				return true;
158 158
 			}
@@ -183,40 +183,40 @@  discard block
 block discarded – undo
183 183
 		// Don't run check when:
184 184
 		// 1. Server has `has_internet_connection` set to false
185 185
 		// 2. AppStore AND S2S is disabled
186
-		if(!$this->config->getSystemValue('has_internet_connection', true)) {
186
+		if (!$this->config->getSystemValue('has_internet_connection', true)) {
187 187
 			return '';
188 188
 		}
189
-		if(!$this->config->getSystemValue('appstoreenabled', true)
189
+		if (!$this->config->getSystemValue('appstoreenabled', true)
190 190
 			&& $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no'
191 191
 			&& $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') {
192 192
 			return '';
193 193
 		}
194 194
 
195 195
 		$versionString = $this->getCurlVersion();
196
-		if(isset($versionString['ssl_version'])) {
196
+		if (isset($versionString['ssl_version'])) {
197 197
 			$versionString = $versionString['ssl_version'];
198 198
 		} else {
199 199
 			return '';
200 200
 		}
201 201
 
202
-		$features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing');
203
-		if(!$this->config->getSystemValue('appstoreenabled', true)) {
204
-			$features = (string)$this->l10n->t('Federated Cloud Sharing');
202
+		$features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing');
203
+		if (!$this->config->getSystemValue('appstoreenabled', true)) {
204
+			$features = (string) $this->l10n->t('Federated Cloud Sharing');
205 205
 		}
206 206
 
207 207
 		// Check if at least OpenSSL after 1.01d or 1.0.2b
208
-		if(strpos($versionString, 'OpenSSL/') === 0) {
208
+		if (strpos($versionString, 'OpenSSL/') === 0) {
209 209
 			$majorVersion = substr($versionString, 8, 5);
210 210
 			$patchRelease = substr($versionString, 13, 6);
211 211
 
212
-			if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) ||
212
+			if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) ||
213 213
 				($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) {
214 214
 				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]);
215 215
 			}
216 216
 		}
217 217
 
218 218
 		// Check if NSS and perform heuristic check
219
-		if(strpos($versionString, 'NSS/') === 0) {
219
+		if (strpos($versionString, 'NSS/') === 0) {
220 220
 			try {
221 221
 				$firstClient = $this->clientService->newClient();
222 222
 				$firstClient->get('https://nextcloud.com/');
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				$secondClient = $this->clientService->newClient();
225 225
 				$secondClient->get('https://nextcloud.com/');
226 226
 			} catch (ClientException $e) {
227
-				if($e->getResponse()->getStatusCode() === 400) {
227
+				if ($e->getResponse()->getStatusCode() === 400) {
228 228
 					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]);
229 229
 				}
230 230
 			}
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
 	 * @return DataResponse
320 320
 	 */
321 321
 	public function getFailedIntegrityCheckFiles() {
322
-		if(!$this->checker->isCodeCheckEnforced()) {
322
+		if (!$this->checker->isCodeCheckEnforced()) {
323 323
 			return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.');
324 324
 		}
325 325
 
326 326
 		$completeResults = $this->checker->getResults();
327 327
 
328
-		if(!empty($completeResults)) {
328
+		if (!empty($completeResults)) {
329 329
 			$formattedTextResponse = 'Technical information
330 330
 =====================
331 331
 The following list covers which files have failed the integrity check. Please read
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
 Results
336 336
 =======
337 337
 ';
338
-			foreach($completeResults as $context => $contextResult) {
338
+			foreach ($completeResults as $context => $contextResult) {
339 339
 				$formattedTextResponse .= "- $context\n";
340 340
 
341
-				foreach($contextResult as $category => $result) {
341
+				foreach ($contextResult as $category => $result) {
342 342
 					$formattedTextResponse .= "\t- $category\n";
343
-					if($category !== 'EXCEPTION') {
343
+					if ($category !== 'EXCEPTION') {
344 344
 						foreach ($result as $key => $results) {
345 345
 							$formattedTextResponse .= "\t\t- $key\n";
346 346
 						}
@@ -383,27 +383,27 @@  discard block
 block discarded – undo
383 383
 
384 384
 		$isOpcacheProperlySetUp = true;
385 385
 
386
-		if(!$iniWrapper->getBool('opcache.enable')) {
386
+		if (!$iniWrapper->getBool('opcache.enable')) {
387 387
 			$isOpcacheProperlySetUp = false;
388 388
 		}
389 389
 
390
-		if(!$iniWrapper->getBool('opcache.save_comments')) {
390
+		if (!$iniWrapper->getBool('opcache.save_comments')) {
391 391
 			$isOpcacheProperlySetUp = false;
392 392
 		}
393 393
 
394
-		if(!$iniWrapper->getBool('opcache.enable_cli')) {
394
+		if (!$iniWrapper->getBool('opcache.enable_cli')) {
395 395
 			$isOpcacheProperlySetUp = false;
396 396
 		}
397 397
 
398
-		if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) {
398
+		if ($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) {
399 399
 			$isOpcacheProperlySetUp = false;
400 400
 		}
401 401
 
402
-		if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) {
402
+		if ($iniWrapper->getNumeric('opcache.memory_consumption') < 128) {
403 403
 			$isOpcacheProperlySetUp = false;
404 404
 		}
405 405
 
406
-		if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) {
406
+		if ($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) {
407 407
 			$isOpcacheProperlySetUp = false;
408 408
 		}
409 409
 
Please login to merge, or discard this patch.