Passed
Push — master ( 90909a...268acd )
by Morris
14:11 queued 11s
created
core/register_command.php 1 patch
Indentation   +132 added lines, -132 removed lines patch added patch discarded remove patch
@@ -54,147 +54,147 @@
 block discarded – undo
54 54
 $application->add(new OC\Core\Command\App\CheckCode());
55 55
 $application->add(new OC\Core\Command\L10n\CreateJs());
56 56
 $application->add(new \OC\Core\Command\Integrity\SignApp(
57
-		\OC::$server->getIntegrityCodeChecker(),
58
-		new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
59
-		\OC::$server->getURLGenerator()
57
+        \OC::$server->getIntegrityCodeChecker(),
58
+        new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
59
+        \OC::$server->getURLGenerator()
60 60
 ));
61 61
 $application->add(new \OC\Core\Command\Integrity\SignCore(
62
-		\OC::$server->getIntegrityCodeChecker(),
63
-		new \OC\IntegrityCheck\Helpers\FileAccessHelper()
62
+        \OC::$server->getIntegrityCodeChecker(),
63
+        new \OC\IntegrityCheck\Helpers\FileAccessHelper()
64 64
 ));
65 65
 $application->add(new \OC\Core\Command\Integrity\CheckApp(
66
-		\OC::$server->getIntegrityCodeChecker()
66
+        \OC::$server->getIntegrityCodeChecker()
67 67
 ));
68 68
 $application->add(new \OC\Core\Command\Integrity\CheckCore(
69
-		\OC::$server->getIntegrityCodeChecker()
69
+        \OC::$server->getIntegrityCodeChecker()
70 70
 ));
71 71
 
72 72
 
73 73
 if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
74
-	$application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
75
-	$application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager(), \OC::$server->getGroupManager()));
76
-	$application->add(new OC\Core\Command\App\Install());
77
-	$application->add(new OC\Core\Command\App\GetPath());
78
-	$application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
79
-	$application->add(new OC\Core\Command\App\Remove(\OC::$server->getAppManager(), \OC::$server->query(\OC\Installer::class), \OC::$server->getLogger()));
80
-	$application->add(\OC::$server->query(\OC\Core\Command\App\Update::class));
81
-
82
-	$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Cleanup::class));
83
-	$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enforce::class));
84
-	$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enable::class));
85
-	$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Disable::class));
86
-	$application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\State::class));
87
-
88
-	$application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
89
-	$application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
90
-	$application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
91
-
92
-	$application->add(\OC::$server->query(\OC\Core\Command\Broadcast\Test::class));
93
-
94
-	$application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
95
-	$application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
96
-	$application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
97
-	$application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
98
-	$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
99
-	$application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
100
-	$application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
101
-	$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
102
-
103
-	$application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
104
-	$application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
105
-	$application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->get(\OC\DB\Connection::class)));
106
-	$application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
107
-	$application->add(new OC\Core\Command\Db\AddMissingColumns(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
108
-	$application->add(new OC\Core\Command\Db\AddMissingPrimaryKeys(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
109
-	$application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->get(\OC\DB\Connection::class)));
110
-	$application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->get(\OC\DB\Connection::class)));
111
-	$application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getAppManager()));
112
-	$application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->get(\OC\DB\Connection::class)));
113
-	$application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getConfig()));
114
-
115
-	$application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
116
-	$application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
117
-	$application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager(), \OC::$server->getConfig()));
118
-	$application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager(), \OC::$server->getConfig()));
119
-	$application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
120
-	$application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
121
-	$application->add(new OC\Core\Command\Encryption\DecryptAll(
122
-		\OC::$server->getEncryptionManager(),
123
-		\OC::$server->getAppManager(),
124
-		\OC::$server->getConfig(),
125
-		new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
126
-		new \Symfony\Component\Console\Helper\QuestionHelper())
127
-	);
128
-
129
-	$application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
130
-	$application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
131
-
132
-	$view = new \OC\Files\View();
133
-	$util = new \OC\Encryption\Util(
134
-		$view,
135
-		\OC::$server->getUserManager(),
136
-		\OC::$server->getGroupManager(),
137
-		\OC::$server->getConfig()
138
-	);
139
-	$application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
140
-			$view,
141
-			\OC::$server->getUserManager(),
142
-			\OC::$server->getConfig(),
143
-			$util,
144
-			new \Symfony\Component\Console\Helper\QuestionHelper()
145
-		)
146
-	);
147
-	$application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
148
-	$application->add(new OC\Core\Command\Encryption\MigrateKeyStorage(
149
-			$view,
150
-			\OC::$server->getUserManager(),
151
-			\OC::$server->getConfig(),
152
-			$util,
153
-			\OC::$server->getCrypto()
154
-		)
155
-	);
156
-
157
-	$application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
158
-	$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
159
-	$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
160
-	$application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
161
-	$application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
162
-	$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
163
-
164
-	$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
165
-	$application->add(new OC\Core\Command\Maintenance\Repair(
166
-		new \OC\Repair([], \OC::$server->getEventDispatcher(), \OC::$server->get(LoggerInterface::class)),
167
-		\OC::$server->getConfig(),
168
-		\OC::$server->getEventDispatcher(),
169
-		\OC::$server->getAppManager()
170
-	));
171
-
172
-	$application->add(\OC::$server->query(\OC\Core\Command\Preview\Repair::class));
173
-	$application->add(\OC::$server->query(\OC\Core\Command\Preview\ResetRenderedTexts::class));
174
-
175
-	$application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
176
-	$application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
177
-	$application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
178
-	$application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
179
-	$application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
180
-	$application->add(\OC::$server->get(\OC\Core\Command\User\Report::class));
181
-	$application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
182
-	$application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
183
-	$application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
184
-	$application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
185
-	$application->add(new OC\Core\Command\User\AddAppPassword(\OC::$server->get(\OCP\IUserManager::class), \OC::$server->get(\OC\Authentication\Token\IProvider::class), \OC::$server->get(\OCP\Security\ISecureRandom::class), \OC::$server->get(\OCP\Security\ICrypto::class)));
186
-
187
-	$application->add(new OC\Core\Command\Group\Add(\OC::$server->getGroupManager()));
188
-	$application->add(new OC\Core\Command\Group\Delete(\OC::$server->getGroupManager()));
189
-	$application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
190
-	$application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
191
-	$application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
192
-	$application->add(new OC\Core\Command\Group\Info(\OC::$server->get(\OCP\IGroupManager::class)));
193
-
194
-	$application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(), \OC::$server->getL10N('core')));
195
-	$application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager()));
196
-	$application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager()));
197
-	$application->add(new OC\Core\Command\Security\ResetBruteforceAttempts(\OC::$server->getBruteForceThrottler()));
74
+    $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
75
+    $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager(), \OC::$server->getGroupManager()));
76
+    $application->add(new OC\Core\Command\App\Install());
77
+    $application->add(new OC\Core\Command\App\GetPath());
78
+    $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
79
+    $application->add(new OC\Core\Command\App\Remove(\OC::$server->getAppManager(), \OC::$server->query(\OC\Installer::class), \OC::$server->getLogger()));
80
+    $application->add(\OC::$server->query(\OC\Core\Command\App\Update::class));
81
+
82
+    $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Cleanup::class));
83
+    $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enforce::class));
84
+    $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Enable::class));
85
+    $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\Disable::class));
86
+    $application->add(\OC::$server->query(\OC\Core\Command\TwoFactorAuth\State::class));
87
+
88
+    $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
89
+    $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
90
+    $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
91
+
92
+    $application->add(\OC::$server->query(\OC\Core\Command\Broadcast\Test::class));
93
+
94
+    $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
95
+    $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
96
+    $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
97
+    $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
98
+    $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
99
+    $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
100
+    $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
101
+    $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
102
+
103
+    $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
104
+    $application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
105
+    $application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->get(\OC\DB\Connection::class)));
106
+    $application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
107
+    $application->add(new OC\Core\Command\Db\AddMissingColumns(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
108
+    $application->add(new OC\Core\Command\Db\AddMissingPrimaryKeys(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getEventDispatcher()));
109
+    $application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->get(\OC\DB\Connection::class)));
110
+    $application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->get(\OC\DB\Connection::class)));
111
+    $application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getAppManager()));
112
+    $application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->get(\OC\DB\Connection::class)));
113
+    $application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->get(\OC\DB\Connection::class), \OC::$server->getConfig()));
114
+
115
+    $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
116
+    $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
117
+    $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager(), \OC::$server->getConfig()));
118
+    $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager(), \OC::$server->getConfig()));
119
+    $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
120
+    $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
121
+    $application->add(new OC\Core\Command\Encryption\DecryptAll(
122
+        \OC::$server->getEncryptionManager(),
123
+        \OC::$server->getAppManager(),
124
+        \OC::$server->getConfig(),
125
+        new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
126
+        new \Symfony\Component\Console\Helper\QuestionHelper())
127
+    );
128
+
129
+    $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
130
+    $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
131
+
132
+    $view = new \OC\Files\View();
133
+    $util = new \OC\Encryption\Util(
134
+        $view,
135
+        \OC::$server->getUserManager(),
136
+        \OC::$server->getGroupManager(),
137
+        \OC::$server->getConfig()
138
+    );
139
+    $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
140
+            $view,
141
+            \OC::$server->getUserManager(),
142
+            \OC::$server->getConfig(),
143
+            $util,
144
+            new \Symfony\Component\Console\Helper\QuestionHelper()
145
+        )
146
+    );
147
+    $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
148
+    $application->add(new OC\Core\Command\Encryption\MigrateKeyStorage(
149
+            $view,
150
+            \OC::$server->getUserManager(),
151
+            \OC::$server->getConfig(),
152
+            $util,
153
+            \OC::$server->getCrypto()
154
+        )
155
+    );
156
+
157
+    $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
158
+    $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
159
+    $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
160
+    $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
161
+    $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
162
+    $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
163
+
164
+    $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
165
+    $application->add(new OC\Core\Command\Maintenance\Repair(
166
+        new \OC\Repair([], \OC::$server->getEventDispatcher(), \OC::$server->get(LoggerInterface::class)),
167
+        \OC::$server->getConfig(),
168
+        \OC::$server->getEventDispatcher(),
169
+        \OC::$server->getAppManager()
170
+    ));
171
+
172
+    $application->add(\OC::$server->query(\OC\Core\Command\Preview\Repair::class));
173
+    $application->add(\OC::$server->query(\OC\Core\Command\Preview\ResetRenderedTexts::class));
174
+
175
+    $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
176
+    $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
177
+    $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
178
+    $application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
179
+    $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
180
+    $application->add(\OC::$server->get(\OC\Core\Command\User\Report::class));
181
+    $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
182
+    $application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
183
+    $application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
184
+    $application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
185
+    $application->add(new OC\Core\Command\User\AddAppPassword(\OC::$server->get(\OCP\IUserManager::class), \OC::$server->get(\OC\Authentication\Token\IProvider::class), \OC::$server->get(\OCP\Security\ISecureRandom::class), \OC::$server->get(\OCP\Security\ICrypto::class)));
186
+
187
+    $application->add(new OC\Core\Command\Group\Add(\OC::$server->getGroupManager()));
188
+    $application->add(new OC\Core\Command\Group\Delete(\OC::$server->getGroupManager()));
189
+    $application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
190
+    $application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
191
+    $application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
192
+    $application->add(new OC\Core\Command\Group\Info(\OC::$server->get(\OCP\IGroupManager::class)));
193
+
194
+    $application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(), \OC::$server->getL10N('core')));
195
+    $application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager()));
196
+    $application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager()));
197
+    $application->add(new OC\Core\Command\Security\ResetBruteforceAttempts(\OC::$server->getBruteForceThrottler()));
198 198
 } else {
199
-	$application->add(\OC::$server->get(\OC\Core\Command\Maintenance\Install::class));
199
+    $application->add(\OC::$server->get(\OC\Core\Command\Maintenance\Install::class));
200 200
 }
Please login to merge, or discard this patch.
core/Command/Preview/ResetRenderedTexts.php 2 patches
Indentation   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -41,162 +41,162 @@
 block discarded – undo
41 41
 
42 42
 class ResetRenderedTexts extends Command {
43 43
 
44
-	/** @var IDBConnection */
45
-	protected $connection;
46
-
47
-	/** @var IUserManager */
48
-	protected $userManager;
49
-
50
-	/** @var IAvatarManager */
51
-	protected $avatarManager;
52
-
53
-	/** @var Root */
54
-	private $previewFolder;
55
-
56
-	/** @var IMimeTypeLoader */
57
-	private $mimeTypeLoader;
58
-
59
-	public function __construct(IDBConnection $connection,
60
-								IUserManager $userManager,
61
-								IAvatarManager $avatarManager,
62
-								Root $previewFolder,
63
-								IMimeTypeLoader $mimeTypeLoader) {
64
-		parent::__construct();
65
-
66
-		$this->connection = $connection;
67
-		$this->userManager = $userManager;
68
-		$this->avatarManager = $avatarManager;
69
-		$this->previewFolder = $previewFolder;
70
-		$this->mimeTypeLoader = $mimeTypeLoader;
71
-	}
72
-
73
-	protected function configure() {
74
-		$this
75
-			->setName('preview:reset-rendered-texts')
76
-			->setDescription('Deletes all generated avatars and previews of text and md files')
77
-			->addOption('dry', 'd', InputOption::VALUE_NONE, 'Dry mode - will not delete any files - in combination with the verbose mode one could check the operations.');
78
-	}
79
-
80
-	protected function execute(InputInterface $input, OutputInterface $output): int {
81
-		$dryMode = $input->getOption('dry');
82
-
83
-		if ($dryMode) {
84
-			$output->writeln('INFO: The command is run in dry mode and will not modify anything.');
85
-			$output->writeln('');
86
-		}
87
-
88
-		$this->deleteAvatars($output, $dryMode);
89
-		$this->deletePreviews($output, $dryMode);
90
-
91
-		return 0;
92
-	}
93
-
94
-	private function deleteAvatars(OutputInterface $output, bool $dryMode): void {
95
-		$avatarsToDeleteCount = 0;
96
-
97
-		foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) {
98
-			$output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE);
99
-
100
-			$avatarsToDeleteCount++;
101
-
102
-			if ($dryMode) {
103
-				continue;
104
-			}
105
-
106
-			try {
107
-				$avatar->remove();
108
-			} catch (NotFoundException $e) {
109
-				// continue
110
-			} catch (NotPermittedException $e) {
111
-				// continue
112
-			}
113
-		}
114
-
115
-		$output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars');
116
-		$output->writeln('');
117
-	}
118
-
119
-	private function getAvatarsToDelete(): \Iterator {
120
-		foreach ($this->userManager->search('') as $user) {
121
-			$avatar = $this->avatarManager->getAvatar($user->getUID());
122
-
123
-			if (!$avatar->isCustomAvatar()) {
124
-				yield [$user->getUID(), $avatar];
125
-			}
126
-		}
127
-	}
128
-
129
-	private function deletePreviews(OutputInterface $output, bool $dryMode): void {
130
-		$previewsToDeleteCount = 0;
131
-
132
-		foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) {
133
-			$output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE);
134
-
135
-			$previewsToDeleteCount++;
136
-
137
-			if ($dryMode) {
138
-				continue;
139
-			}
140
-
141
-			try {
142
-				$preview = $this->previewFolder->getFolder((string)$previewFileId);
143
-				$preview->delete();
144
-			} catch (NotFoundException $e) {
145
-				// continue
146
-			} catch (NotPermittedException $e) {
147
-				// continue
148
-			}
149
-		}
150
-
151
-		$output->writeln('Deleted ' . $previewsToDeleteCount . ' previews');
152
-	}
153
-
154
-	// Copy pasted and adjusted from
155
-	// "lib/private/Preview/BackgroundCleanupJob.php".
156
-	private function getPreviewsToDelete(): \Iterator {
157
-		$qb = $this->connection->getQueryBuilder();
158
-		$qb->select('path', 'mimetype')
159
-			->from('filecache')
160
-			->where($qb->expr()->eq('fileid', $qb->createNamedParameter($this->previewFolder->getId())));
161
-		$cursor = $qb->execute();
162
-		$data = $cursor->fetch();
163
-		$cursor->closeCursor();
164
-
165
-		if ($data === null) {
166
-			return [];
167
-		}
168
-
169
-		/*
44
+    /** @var IDBConnection */
45
+    protected $connection;
46
+
47
+    /** @var IUserManager */
48
+    protected $userManager;
49
+
50
+    /** @var IAvatarManager */
51
+    protected $avatarManager;
52
+
53
+    /** @var Root */
54
+    private $previewFolder;
55
+
56
+    /** @var IMimeTypeLoader */
57
+    private $mimeTypeLoader;
58
+
59
+    public function __construct(IDBConnection $connection,
60
+                                IUserManager $userManager,
61
+                                IAvatarManager $avatarManager,
62
+                                Root $previewFolder,
63
+                                IMimeTypeLoader $mimeTypeLoader) {
64
+        parent::__construct();
65
+
66
+        $this->connection = $connection;
67
+        $this->userManager = $userManager;
68
+        $this->avatarManager = $avatarManager;
69
+        $this->previewFolder = $previewFolder;
70
+        $this->mimeTypeLoader = $mimeTypeLoader;
71
+    }
72
+
73
+    protected function configure() {
74
+        $this
75
+            ->setName('preview:reset-rendered-texts')
76
+            ->setDescription('Deletes all generated avatars and previews of text and md files')
77
+            ->addOption('dry', 'd', InputOption::VALUE_NONE, 'Dry mode - will not delete any files - in combination with the verbose mode one could check the operations.');
78
+    }
79
+
80
+    protected function execute(InputInterface $input, OutputInterface $output): int {
81
+        $dryMode = $input->getOption('dry');
82
+
83
+        if ($dryMode) {
84
+            $output->writeln('INFO: The command is run in dry mode and will not modify anything.');
85
+            $output->writeln('');
86
+        }
87
+
88
+        $this->deleteAvatars($output, $dryMode);
89
+        $this->deletePreviews($output, $dryMode);
90
+
91
+        return 0;
92
+    }
93
+
94
+    private function deleteAvatars(OutputInterface $output, bool $dryMode): void {
95
+        $avatarsToDeleteCount = 0;
96
+
97
+        foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) {
98
+            $output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE);
99
+
100
+            $avatarsToDeleteCount++;
101
+
102
+            if ($dryMode) {
103
+                continue;
104
+            }
105
+
106
+            try {
107
+                $avatar->remove();
108
+            } catch (NotFoundException $e) {
109
+                // continue
110
+            } catch (NotPermittedException $e) {
111
+                // continue
112
+            }
113
+        }
114
+
115
+        $output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars');
116
+        $output->writeln('');
117
+    }
118
+
119
+    private function getAvatarsToDelete(): \Iterator {
120
+        foreach ($this->userManager->search('') as $user) {
121
+            $avatar = $this->avatarManager->getAvatar($user->getUID());
122
+
123
+            if (!$avatar->isCustomAvatar()) {
124
+                yield [$user->getUID(), $avatar];
125
+            }
126
+        }
127
+    }
128
+
129
+    private function deletePreviews(OutputInterface $output, bool $dryMode): void {
130
+        $previewsToDeleteCount = 0;
131
+
132
+        foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) {
133
+            $output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE);
134
+
135
+            $previewsToDeleteCount++;
136
+
137
+            if ($dryMode) {
138
+                continue;
139
+            }
140
+
141
+            try {
142
+                $preview = $this->previewFolder->getFolder((string)$previewFileId);
143
+                $preview->delete();
144
+            } catch (NotFoundException $e) {
145
+                // continue
146
+            } catch (NotPermittedException $e) {
147
+                // continue
148
+            }
149
+        }
150
+
151
+        $output->writeln('Deleted ' . $previewsToDeleteCount . ' previews');
152
+    }
153
+
154
+    // Copy pasted and adjusted from
155
+    // "lib/private/Preview/BackgroundCleanupJob.php".
156
+    private function getPreviewsToDelete(): \Iterator {
157
+        $qb = $this->connection->getQueryBuilder();
158
+        $qb->select('path', 'mimetype')
159
+            ->from('filecache')
160
+            ->where($qb->expr()->eq('fileid', $qb->createNamedParameter($this->previewFolder->getId())));
161
+        $cursor = $qb->execute();
162
+        $data = $cursor->fetch();
163
+        $cursor->closeCursor();
164
+
165
+        if ($data === null) {
166
+            return [];
167
+        }
168
+
169
+        /*
170 170
 		 * This lovely like is the result of the way the new previews are stored
171 171
 		 * We take the md5 of the name (fileid) and split the first 7 chars. That way
172 172
 		 * there are not a gazillion files in the root of the preview appdata.
173 173
 		 */
174
-		$like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%';
175
-
176
-		$qb = $this->connection->getQueryBuilder();
177
-		$qb->select('a.name', 'b.path')
178
-			->from('filecache', 'a')
179
-			->leftJoin('a', 'filecache', 'b', $qb->expr()->eq(
180
-				$qb->expr()->castColumn('a.name', IQueryBuilder::PARAM_INT), 'b.fileid'
181
-			))
182
-			->where(
183
-				$qb->expr()->andX(
184
-					$qb->expr()->like('a.path', $qb->createNamedParameter($like)),
185
-					$qb->expr()->eq('a.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('httpd/unix-directory'))),
186
-					$qb->expr()->orX(
187
-						$qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/plain'))),
188
-						$qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/markdown'))),
189
-						$qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/x-markdown')))
190
-					)
191
-				)
192
-			);
193
-
194
-		$cursor = $qb->execute();
195
-
196
-		while ($row = $cursor->fetch()) {
197
-			yield $row;
198
-		}
199
-
200
-		$cursor->closeCursor();
201
-	}
174
+        $like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%';
175
+
176
+        $qb = $this->connection->getQueryBuilder();
177
+        $qb->select('a.name', 'b.path')
178
+            ->from('filecache', 'a')
179
+            ->leftJoin('a', 'filecache', 'b', $qb->expr()->eq(
180
+                $qb->expr()->castColumn('a.name', IQueryBuilder::PARAM_INT), 'b.fileid'
181
+            ))
182
+            ->where(
183
+                $qb->expr()->andX(
184
+                    $qb->expr()->like('a.path', $qb->createNamedParameter($like)),
185
+                    $qb->expr()->eq('a.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('httpd/unix-directory'))),
186
+                    $qb->expr()->orX(
187
+                        $qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/plain'))),
188
+                        $qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/markdown'))),
189
+                        $qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/x-markdown')))
190
+                    )
191
+                )
192
+            );
193
+
194
+        $cursor = $qb->execute();
195
+
196
+        while ($row = $cursor->fetch()) {
197
+            yield $row;
198
+        }
199
+
200
+        $cursor->closeCursor();
201
+    }
202 202
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$avatarsToDeleteCount = 0;
96 96
 
97 97
 		foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) {
98
-			$output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE);
98
+			$output->writeln('Deleting avatar for '.$userId, OutputInterface::VERBOSITY_VERBOSE);
99 99
 
100 100
 			$avatarsToDeleteCount++;
101 101
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			}
113 113
 		}
114 114
 
115
-		$output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars');
115
+		$output->writeln('Deleted '.$avatarsToDeleteCount.' avatars');
116 116
 		$output->writeln('');
117 117
 	}
118 118
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$previewsToDeleteCount = 0;
131 131
 
132 132
 		foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) {
133
-			$output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE);
133
+			$output->writeln('Deleting previews for '.$filePath, OutputInterface::VERBOSITY_VERBOSE);
134 134
 
135 135
 			$previewsToDeleteCount++;
136 136
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 			}
140 140
 
141 141
 			try {
142
-				$preview = $this->previewFolder->getFolder((string)$previewFileId);
142
+				$preview = $this->previewFolder->getFolder((string) $previewFileId);
143 143
 				$preview->delete();
144 144
 			} catch (NotFoundException $e) {
145 145
 				// continue
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 			}
149 149
 		}
150 150
 
151
-		$output->writeln('Deleted ' . $previewsToDeleteCount . ' previews');
151
+		$output->writeln('Deleted '.$previewsToDeleteCount.' previews');
152 152
 	}
153 153
 
154 154
 	// Copy pasted and adjusted from
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		 * We take the md5 of the name (fileid) and split the first 7 chars. That way
172 172
 		 * there are not a gazillion files in the root of the preview appdata.
173 173
 		 */
174
-		$like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%';
174
+		$like = $this->connection->escapeLikeParameter($data['path']).'/_/_/_/_/_/_/_/%';
175 175
 
176 176
 		$qb = $this->connection->getQueryBuilder();
177 177
 		$qb->select('a.name', 'b.path')
Please login to merge, or discard this patch.