Completed
Push — master ( 1b72dd...b3b630 )
by John
26:15 queued 14s
created
lib/private/Installer.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 			throw new \Exception('App not found in any app directory');
60 60
 		}
61 61
 
62
-		$basedir = $app['path'] . '/' . $appId;
62
+		$basedir = $app['path'].'/'.$appId;
63 63
 
64
-		if (is_file($basedir . '/appinfo/database.xml')) {
65
-			throw new \Exception('The appinfo/database.xml file is not longer supported. Used in ' . $appId);
64
+		if (is_file($basedir.'/appinfo/database.xml')) {
65
+			throw new \Exception('The appinfo/database.xml file is not longer supported. Used in '.$appId);
66 66
 		}
67 67
 
68 68
 		$l = \OCP\Util::getL10N('core');
69
-		$info = \OCP\Server::get(IAppManager::class)->getAppInfoByPath($basedir . '/appinfo/info.xml', $l->getLanguageCode());
69
+		$info = \OCP\Server::get(IAppManager::class)->getAppInfoByPath($basedir.'/appinfo/info.xml', $l->getLanguageCode());
70 70
 
71 71
 		if (!is_array($info)) {
72 72
 			throw new \Exception(
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		\OC_App::setupBackgroundJobs($info['background-jobs']);
113 113
 
114 114
 		//run appinfo/install.php
115
-		self::includeAppScript($basedir . '/appinfo/install.php');
115
+		self::includeAppScript($basedir.'/appinfo/install.php');
116 116
 
117 117
 		OC_App::executeRepairSteps($appId, $info['repair-steps']['install']);
118 118
 
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 
124 124
 		//set remote/public handlers
125 125
 		foreach ($info['remote'] as $name => $path) {
126
-			$config->setAppValue('core', 'remote_' . $name, $info['id'] . '/' . $path);
126
+			$config->setAppValue('core', 'remote_'.$name, $info['id'].'/'.$path);
127 127
 		}
128 128
 		foreach ($info['public'] as $name => $path) {
129
-			$config->setAppValue('core', 'public_' . $name, $info['id'] . '/' . $path);
129
+			$config->setAppValue('core', 'public_'.$name, $info['id'].'/'.$path);
130 130
 		}
131 131
 
132 132
 		OC_App::setAppTypes($info['id']);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			if ($app['id'] === $appId) {
184 184
 				// Load the certificate
185 185
 				$certificate = new X509();
186
-				$rootCrt = file_get_contents(__DIR__ . '/../../resources/codesigning/root.crt');
186
+				$rootCrt = file_get_contents(__DIR__.'/../../resources/codesigning/root.crt');
187 187
 				$rootCrts = $this->splitCerts($rootCrt);
188 188
 				foreach ($rootCrts as $rootCrt) {
189 189
 					$certificate->loadCA($rootCrt);
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 				foreach ($rootCrts as $rootCrt) {
196 196
 					$crl->loadCA($rootCrt);
197 197
 				}
198
-				$crl->loadCRL(file_get_contents(__DIR__ . '/../../resources/codesigning/root.crl'));
198
+				$crl->loadCRL(file_get_contents(__DIR__.'/../../resources/codesigning/root.crl'));
199 199
 				if ($crl->validateSignature() !== true) {
200 200
 					throw new \Exception('Could not validate CRL signature');
201 201
 				}
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 					$archive = new TAR($tempFile);
257 257
 
258 258
 					if (!$archive->extract($extractDir)) {
259
-						$errorMessage = 'Could not extract app ' . $appId;
259
+						$errorMessage = 'Could not extract app '.$appId;
260 260
 
261 261
 						$archiveError = $archive->getError();
262 262
 						if ($archiveError instanceof \PEAR_Error) {
263
-							$errorMessage .= ': ' . $archiveError->getMessage();
263
+							$errorMessage .= ': '.$archiveError->getMessage();
264 264
 						}
265 265
 
266 266
 						throw new \Exception($errorMessage);
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 					}
289 289
 
290 290
 					// Check if appinfo/info.xml has the same app ID as well
291
-					$xml = simplexml_load_string(file_get_contents($extractDir . '/' . $folders[0] . '/appinfo/info.xml'));
291
+					$xml = simplexml_load_string(file_get_contents($extractDir.'/'.$folders[0].'/appinfo/info.xml'));
292 292
 
293 293
 					if ($xml === false) {
294 294
 						throw new \Exception(
@@ -299,19 +299,19 @@  discard block
 block discarded – undo
299 299
 						);
300 300
 					}
301 301
 
302
-					if ((string)$xml->id !== $appId) {
302
+					if ((string) $xml->id !== $appId) {
303 303
 						throw new \Exception(
304 304
 							sprintf(
305 305
 								'App for id %s has a wrong app ID in info.xml: %s',
306 306
 								$appId,
307
-								(string)$xml->id
307
+								(string) $xml->id
308 308
 							)
309 309
 						);
310 310
 					}
311 311
 
312 312
 					// Check if the version is lower than before
313 313
 					$currentVersion = \OCP\Server::get(IAppManager::class)->getAppVersion($appId, true);
314
-					$newVersion = (string)$xml->version;
314
+					$newVersion = (string) $xml->version;
315 315
 					if (version_compare($currentVersion, $newVersion) === 1) {
316 316
 						throw new \Exception(
317 317
 							sprintf(
@@ -323,12 +323,12 @@  discard block
 block discarded – undo
323 323
 						);
324 324
 					}
325 325
 
326
-					$baseDir = OC_App::getInstallPath() . '/' . $appId;
326
+					$baseDir = OC_App::getInstallPath().'/'.$appId;
327 327
 					// Remove old app with the ID if existent
328 328
 					Files::rmdirr($baseDir);
329 329
 					// Move to app folder
330 330
 					if (@mkdir($baseDir)) {
331
-						$extractDir .= '/' . $folders[0];
331
+						$extractDir .= '/'.$folders[0];
332 332
 						OC_Helper::copyr($extractDir, $baseDir);
333 333
 					}
334 334
 					OC_Helper::copyr($extractDir, $baseDir);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 * @param bool $allowUnstable
361 361
 	 * @return string|false false or the version number of the update
362 362
 	 */
363
-	public function isUpdateAvailable($appId, $allowUnstable = false): string|false {
363
+	public function isUpdateAvailable($appId, $allowUnstable = false): string | false {
364 364
 		if ($this->isInstanceReadyForUpdates === null) {
365 365
 			$installPath = OC_App::getInstallPath();
366 366
 			if ($installPath === null) {
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
 		if ($app === false) {
412 412
 			return false;
413 413
 		}
414
-		$basedir = $app['path'] . '/' . $appId;
415
-		return file_exists($basedir . '/.git/');
414
+		$basedir = $app['path'].'/'.$appId;
415
+		return file_exists($basedir.'/.git/');
416 416
 	}
417 417
 
418 418
 	/**
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
 			if (\OCP\Server::get(IAppManager::class)->isShipped($appId)) {
451 451
 				return false;
452 452
 			}
453
-			$appDir = OC_App::getInstallPath() . '/' . $appId;
453
+			$appDir = OC_App::getInstallPath().'/'.$appId;
454 454
 			Files::rmdirr($appDir);
455 455
 			return true;
456 456
 		} else {
457
-			$this->logger->error('can\'t remove app ' . $appId . '. It is not installed.');
457
+			$this->logger->error('can\'t remove app '.$appId.'. It is not installed.');
458 458
 
459 459
 			return false;
460 460
 		}
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
 		foreach (\OC::$APPSROOTS as $app_dir) {
499 499
 			if ($dir = opendir($app_dir['path'])) {
500 500
 				while (false !== ($filename = readdir($dir))) {
501
-					if ($filename[0] !== '.' and is_dir($app_dir['path'] . "/$filename")) {
502
-						if (file_exists($app_dir['path'] . "/$filename/appinfo/info.xml")) {
501
+					if ($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) {
502
+						if (file_exists($app_dir['path']."/$filename/appinfo/info.xml")) {
503 503
 							if ($config->getAppValue($filename, 'installed_version', null) === null) {
504 504
 								$enabled = $appManager->isDefaultEnabled($filename);
505 505
 								if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps()))
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
 	/**
534 534
 	 * install an app already placed in the app folder
535 535
 	 */
536
-	public static function installShippedApp(string $app, ?IOutput $output = null): string|false {
536
+	public static function installShippedApp(string $app, ?IOutput $output = null): string | false {
537 537
 		if ($output instanceof IOutput) {
538
-			$output->debug('Installing ' . $app);
538
+			$output->debug('Installing '.$app);
539 539
 		}
540 540
 
541 541
 		$appManager = \OCP\Server::get(IAppManager::class);
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 			return false;
560 560
 		}
561 561
 		if ($output instanceof IOutput) {
562
-			$output->debug('Registering tasks of ' . $app);
562
+			$output->debug('Registering tasks of '.$app);
563 563
 		}
564 564
 		\OC_App::setupBackgroundJobs($info['background-jobs']);
565 565
 
@@ -572,10 +572,10 @@  discard block
 block discarded – undo
572 572
 
573 573
 		//set remote/public handlers
574 574
 		foreach ($info['remote'] as $name => $path) {
575
-			$config->setAppValue('core', 'remote_' . $name, $app . '/' . $path);
575
+			$config->setAppValue('core', 'remote_'.$name, $app.'/'.$path);
576 576
 		}
577 577
 		foreach ($info['public'] as $name => $path) {
578
-			$config->setAppValue('core', 'public_' . $name, $app . '/' . $path);
578
+			$config->setAppValue('core', 'public_'.$name, $app.'/'.$path);
579 579
 		}
580 580
 
581 581
 		OC_App::setAppTypes($info['id']);
Please login to merge, or discard this patch.