Completed
Pull Request — master (#8232)
by Joas
49:35 queued 32:43
created
lib/private/App/CodeChecker/InfoChecker.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -29,44 +29,44 @@
 block discarded – undo
29 29
 
30 30
 class InfoChecker extends BasicEmitter {
31 31
 
32
-	/** @var IAppManager */
33
-	private $appManager;
32
+    /** @var IAppManager */
33
+    private $appManager;
34 34
 
35
-	public function __construct(IAppManager $appManager) {
36
-		$this->appManager = $appManager;
37
-	}
35
+    public function __construct(IAppManager $appManager) {
36
+        $this->appManager = $appManager;
37
+    }
38 38
 
39
-	/**
40
-	 * @param string $appId
41
-	 * @return array
42
-	 */
43
-	public function analyse($appId): array {
44
-		try {
45
-			$appPath = $this->appManager->getAppPath($appId);
46
-		} catch (AppPathNotFoundException $e) {
47
-			throw new \RuntimeException("No app with given id $appId known.");
48
-		}
39
+    /**
40
+     * @param string $appId
41
+     * @return array
42
+     */
43
+    public function analyse($appId): array {
44
+        try {
45
+            $appPath = $this->appManager->getAppPath($appId);
46
+        } catch (AppPathNotFoundException $e) {
47
+            throw new \RuntimeException("No app with given id $appId known.");
48
+        }
49 49
 
50
-		$xml = new \DOMDocument();
51
-		$xml->load($appPath . '/appinfo/info.xml');
50
+        $xml = new \DOMDocument();
51
+        $xml->load($appPath . '/appinfo/info.xml');
52 52
 
53
-		$schema = \OC::$SERVERROOT . '/resources/app-info.xsd';
54
-		if ($this->appManager->isShipped($appId)) {
55
-			// Shipped apps are allowed to have the public and default_enabled tags
56
-			$schema = \OC::$SERVERROOT . '/resources/app-info-shipped.xsd';
57
-		}
53
+        $schema = \OC::$SERVERROOT . '/resources/app-info.xsd';
54
+        if ($this->appManager->isShipped($appId)) {
55
+            // Shipped apps are allowed to have the public and default_enabled tags
56
+            $schema = \OC::$SERVERROOT . '/resources/app-info-shipped.xsd';
57
+        }
58 58
 
59
-		$errors = [];
60
-		if (!$xml->schemaValidate($schema)) {
61
-			foreach (libxml_get_errors() as $error) {
62
-				$errors[] = [
63
-					'type' => 'parseError',
64
-					'field' => $error->message,
65
-				];
66
-				$this->emit('InfoChecker', 'parseError', [$error->message]);
67
-			}
68
-		}
59
+        $errors = [];
60
+        if (!$xml->schemaValidate($schema)) {
61
+            foreach (libxml_get_errors() as $error) {
62
+                $errors[] = [
63
+                    'type' => 'parseError',
64
+                    'field' => $error->message,
65
+                ];
66
+                $this->emit('InfoChecker', 'parseError', [$error->message]);
67
+            }
68
+        }
69 69
 
70
-		return $errors;
71
-	}
70
+        return $errors;
71
+    }
72 72
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
 		}
49 49
 
50 50
 		$xml = new \DOMDocument();
51
-		$xml->load($appPath . '/appinfo/info.xml');
51
+		$xml->load($appPath.'/appinfo/info.xml');
52 52
 
53
-		$schema = \OC::$SERVERROOT . '/resources/app-info.xsd';
53
+		$schema = \OC::$SERVERROOT.'/resources/app-info.xsd';
54 54
 		if ($this->appManager->isShipped($appId)) {
55 55
 			// Shipped apps are allowed to have the public and default_enabled tags
56
-			$schema = \OC::$SERVERROOT . '/resources/app-info-shipped.xsd';
56
+			$schema = \OC::$SERVERROOT.'/resources/app-info-shipped.xsd';
57 57
 		}
58 58
 
59 59
 		$errors = [];
Please login to merge, or discard this patch.
core/Command/App/CheckCode.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 use OC\App\CodeChecker\DeprecationCheck;
43 43
 use OC\App\CodeChecker\PrivateCheck;
44 44
 
45
-class CheckCode extends Command implements CompletionAwareInterface  {
45
+class CheckCode extends Command implements CompletionAwareInterface {
46 46
 
47 47
 	protected $checkers = [
48 48
 		'private' => PrivateCheck::class,
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				'c',
65 65
 				InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
66 66
 				'enable the specified checker(s)',
67
-				[ 'private', 'deprecation', 'strong-comparison' ]
67
+				['private', 'deprecation', 'strong-comparison']
68 68
 			)
69 69
 			->addOption(
70 70
 				'--skip-checkers',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$codeChecker = new CodeChecker($checkList, !$input->getOption('skip-validate-info'));
96 96
 
97 97
 		$codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) {
98
-			if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
98
+			if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
99 99
 				$output->writeln("<info>Analysing {$params}</info>");
100 100
 			}
101 101
 		});
@@ -103,29 +103,29 @@  discard block
 block discarded – undo
103 103
 			$count = count($errors);
104 104
 
105 105
 			// show filename if the verbosity is low, but there are errors in a file
106
-			if($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
106
+			if ($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
107 107
 				$output->writeln("<info>Analysing {$filename}</info>");
108 108
 			}
109 109
 
110 110
 			// show error count if there are errors present or the verbosity is high
111
-			if($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
111
+			if ($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
112 112
 				$output->writeln(" {$count} errors");
113 113
 			}
114 114
 			usort($errors, function($a, $b) {
115
-				return $a['line'] >$b['line'];
115
+				return $a['line'] > $b['line'];
116 116
 			});
117 117
 
118
-			foreach($errors as $p) {
118
+			foreach ($errors as $p) {
119 119
 				$line = sprintf("%' 4d", $p['line']);
120 120
 				$output->writeln("    <error>line $line: {$p['disallowedToken']} - {$p['reason']}</error>");
121 121
 			}
122 122
 		});
123 123
 		$errors = [];
124
-		if(!$input->getOption('skip-checkers')) {
124
+		if (!$input->getOption('skip-checkers')) {
125 125
 			$errors = $codeChecker->analyse($appId);
126 126
 		}
127 127
 
128
-		if(!$input->getOption('skip-validate-info')) {
128
+		if (!$input->getOption('skip-validate-info')) {
129 129
 			// Can not inject because of circular dependency
130 130
 			$infoChecker = new InfoChecker(\OC::$server->getAppManager());
131 131
 			$infoChecker->listen('InfoChecker', 'parseError', function($error) use ($output) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			throw new \RuntimeException("No app with given id <$appId> known.");
180 180
 		}
181 181
 
182
-		$updatePhp = $appPath . '/appinfo/update.php';
182
+		$updatePhp = $appPath.'/appinfo/update.php';
183 183
 		if (file_exists($updatePhp)) {
184 184
 			$output->writeln("<info>Deprecated file found: $updatePhp - please use repair steps</info>");
185 185
 		}
Please login to merge, or discard this patch.
Indentation   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -44,177 +44,177 @@
 block discarded – undo
44 44
 
45 45
 class CheckCode extends Command implements CompletionAwareInterface  {
46 46
 
47
-	protected $checkers = [
48
-		'private' => PrivateCheck::class,
49
-		'deprecation' => DeprecationCheck::class,
50
-		'strong-comparison' => StrongComparisonCheck::class,
51
-	];
52
-
53
-	protected function configure() {
54
-		$this
55
-			->setName('app:check-code')
56
-			->setDescription('check code to be compliant')
57
-			->addArgument(
58
-				'app-id',
59
-				InputArgument::REQUIRED,
60
-				'check the specified app'
61
-			)
62
-			->addOption(
63
-				'checker',
64
-				'c',
65
-				InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
66
-				'enable the specified checker(s)',
67
-				[ 'private', 'deprecation', 'strong-comparison' ]
68
-			)
69
-			->addOption(
70
-				'--skip-checkers',
71
-				null,
72
-				InputOption::VALUE_NONE,
73
-				'skips the the code checkers to only check info.xml, language and database schema'
74
-			)
75
-			->addOption(
76
-				'--skip-validate-info',
77
-				null,
78
-				InputOption::VALUE_NONE,
79
-				'skips the info.xml/version check'
80
-			);
81
-	}
82
-
83
-	protected function execute(InputInterface $input, OutputInterface $output) {
84
-		try {
85
-			return $this->execute2($input, $output);
86
-		} catch (\Exception $e) {
87
-			$output->writeln(json_encode($e->getTrace(), JSON_PRETTY_PRINT));
88
-			$output->writeln($e->getMessage());
89
-			$output->writeln($e->getTraceAsString());
90
-		}
91
-	}
92
-	protected function execute2(InputInterface $input, OutputInterface $output) {
93
-		$appId = $input->getArgument('app-id');
94
-
95
-		$checkList = new EmptyCheck();
96
-		foreach ($input->getOption('checker') as $checker) {
97
-			if (!isset($this->checkers[$checker])) {
98
-				throw new \InvalidArgumentException('Invalid checker: '.$checker);
99
-			}
100
-			$checkerClass = $this->checkers[$checker];
101
-			$checkList = new $checkerClass($checkList);
102
-		}
103
-
104
-		$codeChecker = new CodeChecker($checkList, !$input->getOption('skip-validate-info'));
105
-
106
-		$codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) {
107
-			if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
108
-				$output->writeln("<info>Analysing {$params}</info>");
109
-			}
110
-		});
111
-		$codeChecker->listen('CodeChecker', 'analyseFileFinished', function($filename, $errors) use ($output) {
112
-			$count = count($errors);
113
-
114
-			// show filename if the verbosity is low, but there are errors in a file
115
-			if($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
116
-				$output->writeln("<info>Analysing {$filename}</info>");
117
-			}
118
-
119
-			// show error count if there are errors present or the verbosity is high
120
-			if($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
121
-				$output->writeln(" {$count} errors");
122
-			}
123
-			usort($errors, function($a, $b) {
124
-				return $a['line'] >$b['line'];
125
-			});
126
-
127
-			foreach($errors as $p) {
128
-				$line = sprintf("%' 4d", $p['line']);
129
-				$output->writeln("    <error>line $line: {$p['disallowedToken']} - {$p['reason']}</error>");
130
-			}
131
-		});
132
-		$errors = [];
133
-		if(!$input->getOption('skip-checkers')) {
134
-			$errors = $codeChecker->analyse($appId);
135
-		}
136
-
137
-		if(!$input->getOption('skip-validate-info')) {
138
-			// Can not inject because of circular dependency
139
-			$infoChecker = new InfoChecker(\OC::$server->getAppManager());
140
-			$infoChecker->listen('InfoChecker', 'parseError', function($error) use ($output) {
141
-				$output->writeln("<error>Invalid appinfo.xml file found: $error</error>");
142
-			});
143
-
144
-			$infoErrors = $infoChecker->analyse($appId);
145
-
146
-			$errors = array_merge($errors, $infoErrors);
147
-
148
-			$languageParser = new LanguageParseChecker();
149
-			$languageErrors = $languageParser->analyse($appId);
150
-
151
-			foreach ($languageErrors as $languageError) {
152
-				$output->writeln("<error>$languageError</error>");
153
-			}
154
-
155
-			$errors = array_merge($errors, $languageErrors);
156
-
157
-			$databaseSchema = new DatabaseSchemaChecker();
158
-			$schemaErrors = $databaseSchema->analyse($appId);
159
-
160
-			foreach ($schemaErrors['errors'] as $schemaError) {
161
-				$output->writeln("<error>$schemaError</error>");
162
-			}
163
-			foreach ($schemaErrors['warnings'] as $schemaWarning) {
164
-				$output->writeln("<comment>$schemaWarning</comment>");
165
-			}
166
-
167
-			$errors = array_merge($errors, $schemaErrors['errors']);
168
-		}
169
-
170
-		$this->analyseUpdateFile($appId, $output);
171
-
172
-		if (empty($errors)) {
173
-			$output->writeln('<info>App is compliant - awesome job!</info>');
174
-			return 0;
175
-		} else {
176
-			$output->writeln('<error>App is not compliant</error>');
177
-			return 101;
178
-		}
179
-	}
180
-
181
-	/**
182
-	 * @param string $appId
183
-	 * @param $output
184
-	 */
185
-	private function analyseUpdateFile($appId, OutputInterface $output) {
186
-		$appPath = \OC_App::getAppPath($appId);
187
-		if ($appPath === false) {
188
-			throw new \RuntimeException("No app with given id <$appId> known.");
189
-		}
190
-
191
-		$updatePhp = $appPath . '/appinfo/update.php';
192
-		if (file_exists($updatePhp)) {
193
-			$output->writeln("<info>Deprecated file found: $updatePhp - please use repair steps</info>");
194
-		}
195
-	}
196
-
197
-	/**
198
-	 * @param string $optionName
199
-	 * @param CompletionContext $context
200
-	 * @return string[]
201
-	 */
202
-	public function completeOptionValues($optionName, CompletionContext $context) {
203
-		if ($optionName === 'checker') {
204
-			return ['private', 'deprecation', 'strong-comparison'];
205
-		}
206
-		return [];
207
-	}
208
-
209
-	/**
210
-	 * @param string $argumentName
211
-	 * @param CompletionContext $context
212
-	 * @return string[]
213
-	 */
214
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
215
-		if ($argumentName === 'app-id') {
216
-			return \OC_App::getAllApps();
217
-		}
218
-		return [];
219
-	}
47
+    protected $checkers = [
48
+        'private' => PrivateCheck::class,
49
+        'deprecation' => DeprecationCheck::class,
50
+        'strong-comparison' => StrongComparisonCheck::class,
51
+    ];
52
+
53
+    protected function configure() {
54
+        $this
55
+            ->setName('app:check-code')
56
+            ->setDescription('check code to be compliant')
57
+            ->addArgument(
58
+                'app-id',
59
+                InputArgument::REQUIRED,
60
+                'check the specified app'
61
+            )
62
+            ->addOption(
63
+                'checker',
64
+                'c',
65
+                InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
66
+                'enable the specified checker(s)',
67
+                [ 'private', 'deprecation', 'strong-comparison' ]
68
+            )
69
+            ->addOption(
70
+                '--skip-checkers',
71
+                null,
72
+                InputOption::VALUE_NONE,
73
+                'skips the the code checkers to only check info.xml, language and database schema'
74
+            )
75
+            ->addOption(
76
+                '--skip-validate-info',
77
+                null,
78
+                InputOption::VALUE_NONE,
79
+                'skips the info.xml/version check'
80
+            );
81
+    }
82
+
83
+    protected function execute(InputInterface $input, OutputInterface $output) {
84
+        try {
85
+            return $this->execute2($input, $output);
86
+        } catch (\Exception $e) {
87
+            $output->writeln(json_encode($e->getTrace(), JSON_PRETTY_PRINT));
88
+            $output->writeln($e->getMessage());
89
+            $output->writeln($e->getTraceAsString());
90
+        }
91
+    }
92
+    protected function execute2(InputInterface $input, OutputInterface $output) {
93
+        $appId = $input->getArgument('app-id');
94
+
95
+        $checkList = new EmptyCheck();
96
+        foreach ($input->getOption('checker') as $checker) {
97
+            if (!isset($this->checkers[$checker])) {
98
+                throw new \InvalidArgumentException('Invalid checker: '.$checker);
99
+            }
100
+            $checkerClass = $this->checkers[$checker];
101
+            $checkList = new $checkerClass($checkList);
102
+        }
103
+
104
+        $codeChecker = new CodeChecker($checkList, !$input->getOption('skip-validate-info'));
105
+
106
+        $codeChecker->listen('CodeChecker', 'analyseFileBegin', function($params) use ($output) {
107
+            if(OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
108
+                $output->writeln("<info>Analysing {$params}</info>");
109
+            }
110
+        });
111
+        $codeChecker->listen('CodeChecker', 'analyseFileFinished', function($filename, $errors) use ($output) {
112
+            $count = count($errors);
113
+
114
+            // show filename if the verbosity is low, but there are errors in a file
115
+            if($count > 0 && OutputInterface::VERBOSITY_VERBOSE > $output->getVerbosity()) {
116
+                $output->writeln("<info>Analysing {$filename}</info>");
117
+            }
118
+
119
+            // show error count if there are errors present or the verbosity is high
120
+            if($count > 0 || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
121
+                $output->writeln(" {$count} errors");
122
+            }
123
+            usort($errors, function($a, $b) {
124
+                return $a['line'] >$b['line'];
125
+            });
126
+
127
+            foreach($errors as $p) {
128
+                $line = sprintf("%' 4d", $p['line']);
129
+                $output->writeln("    <error>line $line: {$p['disallowedToken']} - {$p['reason']}</error>");
130
+            }
131
+        });
132
+        $errors = [];
133
+        if(!$input->getOption('skip-checkers')) {
134
+            $errors = $codeChecker->analyse($appId);
135
+        }
136
+
137
+        if(!$input->getOption('skip-validate-info')) {
138
+            // Can not inject because of circular dependency
139
+            $infoChecker = new InfoChecker(\OC::$server->getAppManager());
140
+            $infoChecker->listen('InfoChecker', 'parseError', function($error) use ($output) {
141
+                $output->writeln("<error>Invalid appinfo.xml file found: $error</error>");
142
+            });
143
+
144
+            $infoErrors = $infoChecker->analyse($appId);
145
+
146
+            $errors = array_merge($errors, $infoErrors);
147
+
148
+            $languageParser = new LanguageParseChecker();
149
+            $languageErrors = $languageParser->analyse($appId);
150
+
151
+            foreach ($languageErrors as $languageError) {
152
+                $output->writeln("<error>$languageError</error>");
153
+            }
154
+
155
+            $errors = array_merge($errors, $languageErrors);
156
+
157
+            $databaseSchema = new DatabaseSchemaChecker();
158
+            $schemaErrors = $databaseSchema->analyse($appId);
159
+
160
+            foreach ($schemaErrors['errors'] as $schemaError) {
161
+                $output->writeln("<error>$schemaError</error>");
162
+            }
163
+            foreach ($schemaErrors['warnings'] as $schemaWarning) {
164
+                $output->writeln("<comment>$schemaWarning</comment>");
165
+            }
166
+
167
+            $errors = array_merge($errors, $schemaErrors['errors']);
168
+        }
169
+
170
+        $this->analyseUpdateFile($appId, $output);
171
+
172
+        if (empty($errors)) {
173
+            $output->writeln('<info>App is compliant - awesome job!</info>');
174
+            return 0;
175
+        } else {
176
+            $output->writeln('<error>App is not compliant</error>');
177
+            return 101;
178
+        }
179
+    }
180
+
181
+    /**
182
+     * @param string $appId
183
+     * @param $output
184
+     */
185
+    private function analyseUpdateFile($appId, OutputInterface $output) {
186
+        $appPath = \OC_App::getAppPath($appId);
187
+        if ($appPath === false) {
188
+            throw new \RuntimeException("No app with given id <$appId> known.");
189
+        }
190
+
191
+        $updatePhp = $appPath . '/appinfo/update.php';
192
+        if (file_exists($updatePhp)) {
193
+            $output->writeln("<info>Deprecated file found: $updatePhp - please use repair steps</info>");
194
+        }
195
+    }
196
+
197
+    /**
198
+     * @param string $optionName
199
+     * @param CompletionContext $context
200
+     * @return string[]
201
+     */
202
+    public function completeOptionValues($optionName, CompletionContext $context) {
203
+        if ($optionName === 'checker') {
204
+            return ['private', 'deprecation', 'strong-comparison'];
205
+        }
206
+        return [];
207
+    }
208
+
209
+    /**
210
+     * @param string $argumentName
211
+     * @param CompletionContext $context
212
+     * @return string[]
213
+     */
214
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
215
+        if ($argumentName === 'app-id') {
216
+            return \OC_App::getAllApps();
217
+        }
218
+        return [];
219
+    }
220 220
 }
Please login to merge, or discard this patch.
core/register_command.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -43,123 +43,123 @@
 block discarded – undo
43 43
 $application->add(new OC\Core\Command\App\CheckCode());
44 44
 $application->add(new OC\Core\Command\L10n\CreateJs());
45 45
 $application->add(new \OC\Core\Command\Integrity\SignApp(
46
-		\OC::$server->getIntegrityCodeChecker(),
47
-		new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
48
-		\OC::$server->getURLGenerator()
46
+        \OC::$server->getIntegrityCodeChecker(),
47
+        new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
48
+        \OC::$server->getURLGenerator()
49 49
 ));
50 50
 $application->add(new \OC\Core\Command\Integrity\SignCore(
51
-		\OC::$server->getIntegrityCodeChecker(),
52
-		new \OC\IntegrityCheck\Helpers\FileAccessHelper()
51
+        \OC::$server->getIntegrityCodeChecker(),
52
+        new \OC\IntegrityCheck\Helpers\FileAccessHelper()
53 53
 ));
54 54
 $application->add(new \OC\Core\Command\Integrity\CheckApp(
55
-		\OC::$server->getIntegrityCodeChecker()
55
+        \OC::$server->getIntegrityCodeChecker()
56 56
 ));
57 57
 $application->add(new \OC\Core\Command\Integrity\CheckCore(
58
-		\OC::$server->getIntegrityCodeChecker()
58
+        \OC::$server->getIntegrityCodeChecker()
59 59
 ));
60 60
 
61 61
 
62 62
 if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
63
-	$application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
64
-	$application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager()));
65
-	$application->add(new OC\Core\Command\App\Install());
66
-	$application->add(new OC\Core\Command\App\GetPath());
67
-	$application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
63
+    $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
64
+    $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager()));
65
+    $application->add(new OC\Core\Command\App\Install());
66
+    $application->add(new OC\Core\Command\App\GetPath());
67
+    $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
68 68
 
69
-	$application->add(new OC\Core\Command\TwoFactorAuth\Enable(
70
-		\OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
71
-	));
72
-	$application->add(new OC\Core\Command\TwoFactorAuth\Disable(
73
-		\OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
74
-	));
69
+    $application->add(new OC\Core\Command\TwoFactorAuth\Enable(
70
+        \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
71
+    ));
72
+    $application->add(new OC\Core\Command\TwoFactorAuth\Disable(
73
+        \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
74
+    ));
75 75
 
76
-	$application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
77
-	$application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
78
-	$application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
76
+    $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
77
+    $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
78
+    $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
79 79
 
80
-	$application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
81
-	$application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
82
-	$application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
83
-	$application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
84
-	$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
85
-	$application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
86
-	$application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
87
-	$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
80
+    $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
81
+    $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
82
+    $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
83
+    $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
84
+    $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
85
+    $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
86
+    $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
87
+    $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
88 88
 
89
-	$application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
90
-	$application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
91
-	$application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->getDatabaseConnection()));
92
-	$application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->getDatabaseConnection()));
93
-	$application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->getDatabaseConnection()));
94
-	$application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->getDatabaseConnection()));
95
-	$application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->getDatabaseConnection()));
96
-	$application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->getDatabaseConnection()));
97
-	$application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()));
89
+    $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
90
+    $application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
91
+    $application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->getDatabaseConnection()));
92
+    $application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->getDatabaseConnection()));
93
+    $application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->getDatabaseConnection()));
94
+    $application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->getDatabaseConnection()));
95
+    $application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->getDatabaseConnection()));
96
+    $application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->getDatabaseConnection()));
97
+    $application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()));
98 98
 
99
-	$application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
100
-	$application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
101
-	$application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
102
-	$application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
103
-	$application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
104
-	$application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
105
-	$application->add(new OC\Core\Command\Encryption\DecryptAll(
106
-		\OC::$server->getEncryptionManager(),
107
-		\OC::$server->getAppManager(),
108
-		\OC::$server->getConfig(),
109
-		new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
110
-		new \Symfony\Component\Console\Helper\QuestionHelper())
111
-	);
99
+    $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
100
+    $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
101
+    $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
102
+    $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
103
+    $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
104
+    $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
105
+    $application->add(new OC\Core\Command\Encryption\DecryptAll(
106
+        \OC::$server->getEncryptionManager(),
107
+        \OC::$server->getAppManager(),
108
+        \OC::$server->getConfig(),
109
+        new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
110
+        new \Symfony\Component\Console\Helper\QuestionHelper())
111
+    );
112 112
 
113
-	$application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
114
-	$application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
113
+    $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
114
+    $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
115 115
 
116
-	$view = new \OC\Files\View();
117
-	$util = new \OC\Encryption\Util(
118
-		$view,
119
-		\OC::$server->getUserManager(),
120
-		\OC::$server->getGroupManager(),
121
-		\OC::$server->getConfig()
122
-	);
123
-	$application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
124
-			$view,
125
-			\OC::$server->getUserManager(),
126
-			\OC::$server->getConfig(),
127
-			$util,
128
-			new \Symfony\Component\Console\Helper\QuestionHelper()
129
-		)
130
-	);
131
-	$application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
116
+    $view = new \OC\Files\View();
117
+    $util = new \OC\Encryption\Util(
118
+        $view,
119
+        \OC::$server->getUserManager(),
120
+        \OC::$server->getGroupManager(),
121
+        \OC::$server->getConfig()
122
+    );
123
+    $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
124
+            $view,
125
+            \OC::$server->getUserManager(),
126
+            \OC::$server->getConfig(),
127
+            $util,
128
+            new \Symfony\Component\Console\Helper\QuestionHelper()
129
+        )
130
+    );
131
+    $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
132 132
 
133
-	$application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
134
-	$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
135
-	$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
136
-	$application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
137
-	$application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
138
-	$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
133
+    $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
134
+    $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
135
+    $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
136
+    $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
137
+    $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
138
+    $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
139 139
 
140
-	$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
141
-	$application->add(new OC\Core\Command\Maintenance\Repair(
142
-		new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(),
143
-		\OC::$server->getEventDispatcher(), \OC::$server->getAppManager()));
140
+    $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
141
+    $application->add(new OC\Core\Command\Maintenance\Repair(
142
+        new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(),
143
+        \OC::$server->getEventDispatcher(), \OC::$server->getAppManager()));
144 144
 
145
-	$application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
146
-	$application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
147
-	$application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
148
-	$application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
149
-	$application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
150
-	$application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
151
-	$application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
152
-	$application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
153
-	$application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager()));
154
-	$application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
145
+    $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
146
+    $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
147
+    $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
148
+    $application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
149
+    $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
150
+    $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
151
+    $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
152
+    $application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
153
+    $application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager()));
154
+    $application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
155 155
 
156
-	$application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
157
-	$application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
158
-	$application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
156
+    $application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
157
+    $application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
158
+    $application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
159 159
 
160
-	$application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core')));
161
-	$application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null)));
162
-	$application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null)));
160
+    $application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core')));
161
+    $application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null)));
162
+    $application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null)));
163 163
 } else {
164
-	$application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getSystemConfig()));
164
+    $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getSystemConfig()));
165 165
 }
Please login to merge, or discard this patch.
console.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -39,58 +39,58 @@
 block discarded – undo
39 39
 
40 40
 function exceptionHandler($exception) {
41 41
 
42
-	echo "An unhandled exception has been thrown:" . PHP_EOL;
43
-	echo $exception;
44
-	exit(1);
42
+    echo "An unhandled exception has been thrown:" . PHP_EOL;
43
+    echo $exception;
44
+    exit(1);
45 45
 }
46 46
 try {
47
-	require_once __DIR__ . '/lib/base.php';
47
+    require_once __DIR__ . '/lib/base.php';
48 48
 
49
-	// set to run indefinitely if needed
50
-	if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
51
-		@set_time_limit(0);
52
-	}
49
+    // set to run indefinitely if needed
50
+    if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
51
+        @set_time_limit(0);
52
+    }
53 53
 
54
-	if (!OC::$CLI) {
55
-		echo "This script can be run from the command line only" . PHP_EOL;
56
-		exit(1);
57
-	}
54
+    if (!OC::$CLI) {
55
+        echo "This script can be run from the command line only" . PHP_EOL;
56
+        exit(1);
57
+    }
58 58
 
59
-	set_exception_handler('exceptionHandler');
59
+    set_exception_handler('exceptionHandler');
60 60
 
61
-	if (!function_exists('posix_getuid')) {
62
-		echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
63
-		exit(1);
64
-	}
65
-	$user = posix_getpwuid(posix_getuid());
66
-	$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
67
-	if ($user['name'] !== $configUser['name']) {
68
-		echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL;
69
-		echo "Current user: " . $user['name'] . PHP_EOL;
70
-		echo "Owner of config.php: " . $configUser['name'] . PHP_EOL;
71
-		echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
72
-		exit(1);
73
-	}
61
+    if (!function_exists('posix_getuid')) {
62
+        echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
63
+        exit(1);
64
+    }
65
+    $user = posix_getpwuid(posix_getuid());
66
+    $configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
67
+    if ($user['name'] !== $configUser['name']) {
68
+        echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL;
69
+        echo "Current user: " . $user['name'] . PHP_EOL;
70
+        echo "Owner of config.php: " . $configUser['name'] . PHP_EOL;
71
+        echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
72
+        exit(1);
73
+    }
74 74
 
75
-	$oldWorkingDir = getcwd();
76
-	if ($oldWorkingDir === false) {
77
-		echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
78
-		echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL;
79
-	} else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) {
80
-		echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
81
-		echo "Can't change to Nextcloud root directory." . PHP_EOL;
82
-		exit(1);
83
-	}
75
+    $oldWorkingDir = getcwd();
76
+    if ($oldWorkingDir === false) {
77
+        echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
78
+        echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL;
79
+    } else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) {
80
+        echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
81
+        echo "Can't change to Nextcloud root directory." . PHP_EOL;
82
+        exit(1);
83
+    }
84 84
 
85
-	if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) {
86
-		echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL;
87
-	}
85
+    if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) {
86
+        echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL;
87
+    }
88 88
 
89
-	$application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest(), \OC::$server->getLogger());
90
-	$application->loadCommands(new ArgvInput(), new ConsoleOutput());
91
-	$application->run();
89
+    $application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest(), \OC::$server->getLogger());
90
+    $application->loadCommands(new ArgvInput(), new ConsoleOutput());
91
+    $application->run();
92 92
 } catch (Exception $ex) {
93
-	exceptionHandler($ex);
93
+    exceptionHandler($ex);
94 94
 } catch (Error $ex) {
95
-	exceptionHandler($ex);
95
+    exceptionHandler($ex);
96 96
 }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  *
30 30
  */
31 31
 
32
-require_once __DIR__ . '/lib/versioncheck.php';
32
+require_once __DIR__.'/lib/versioncheck.php';
33 33
 
34 34
 use OC\Console\Application;
35 35
 use Symfony\Component\Console\Input\ArgvInput;
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 
40 40
 function exceptionHandler($exception) {
41 41
 
42
-	echo "An unhandled exception has been thrown:" . PHP_EOL;
42
+	echo "An unhandled exception has been thrown:".PHP_EOL;
43 43
 	echo $exception;
44 44
 	exit(1);
45 45
 }
46 46
 try {
47
-	require_once __DIR__ . '/lib/base.php';
47
+	require_once __DIR__.'/lib/base.php';
48 48
 
49 49
 	// set to run indefinitely if needed
50 50
 	if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
@@ -52,38 +52,38 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	if (!OC::$CLI) {
55
-		echo "This script can be run from the command line only" . PHP_EOL;
55
+		echo "This script can be run from the command line only".PHP_EOL;
56 56
 		exit(1);
57 57
 	}
58 58
 
59 59
 	set_exception_handler('exceptionHandler');
60 60
 
61 61
 	if (!function_exists('posix_getuid')) {
62
-		echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
62
+		echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php".PHP_EOL;
63 63
 		exit(1);
64 64
 	}
65 65
 	$user = posix_getpwuid(posix_getuid());
66
-	$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
66
+	$configUser = posix_getpwuid(fileowner(OC::$configDir.'config.php'));
67 67
 	if ($user['name'] !== $configUser['name']) {
68
-		echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL;
69
-		echo "Current user: " . $user['name'] . PHP_EOL;
70
-		echo "Owner of config.php: " . $configUser['name'] . PHP_EOL;
71
-		echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
68
+		echo "Console has to be executed with the user that owns the file config/config.php".PHP_EOL;
69
+		echo "Current user: ".$user['name'].PHP_EOL;
70
+		echo "Owner of config.php: ".$configUser['name'].PHP_EOL;
71
+		echo "Try adding 'sudo -u ".$configUser['name']." ' to the beginning of the command (without the single quotes)".PHP_EOL;
72 72
 		exit(1);
73 73
 	}
74 74
 
75 75
 	$oldWorkingDir = getcwd();
76 76
 	if ($oldWorkingDir === false) {
77
-		echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
78
-		echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL;
77
+		echo "This script can be run from the Nextcloud root directory only.".PHP_EOL;
78
+		echo "Can't determine current working dir - the script will continue to work but be aware of the above fact.".PHP_EOL;
79 79
 	} else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) {
80
-		echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
81
-		echo "Can't change to Nextcloud root directory." . PHP_EOL;
80
+		echo "This script can be run from the Nextcloud root directory only.".PHP_EOL;
81
+		echo "Can't change to Nextcloud root directory.".PHP_EOL;
82 82
 		exit(1);
83 83
 	}
84 84
 
85 85
 	if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) {
86
-		echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL;
86
+		echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php".PHP_EOL;
87 87
 	}
88 88
 
89 89
 	$application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest(), \OC::$server->getLogger());
Please login to merge, or discard this patch.