@@ -123,142 +123,142 @@ |
||
123 | 123 | $config = Server::get(IConfig::class); |
124 | 124 | |
125 | 125 | if ($config->getSystemValueBool('installed', false)) { |
126 | - $application->add(Server::get(Disable::class)); |
|
127 | - $application->add(Server::get(Enable::class)); |
|
128 | - $application->add(Server::get(Install::class)); |
|
129 | - $application->add(Server::get(GetPath::class)); |
|
130 | - $application->add(Server::get(ListApps::class)); |
|
131 | - $application->add(Server::get(Remove::class)); |
|
132 | - $application->add(Server::get(Update::class)); |
|
126 | + $application->add(Server::get(Disable::class)); |
|
127 | + $application->add(Server::get(Enable::class)); |
|
128 | + $application->add(Server::get(Install::class)); |
|
129 | + $application->add(Server::get(GetPath::class)); |
|
130 | + $application->add(Server::get(ListApps::class)); |
|
131 | + $application->add(Server::get(Remove::class)); |
|
132 | + $application->add(Server::get(Update::class)); |
|
133 | 133 | |
134 | - $application->add(Server::get(Cleanup::class)); |
|
135 | - $application->add(Server::get(Enforce::class)); |
|
136 | - $application->add(Server::get(Command\TwoFactorAuth\Enable::class)); |
|
137 | - $application->add(Server::get(Command\TwoFactorAuth\Disable::class)); |
|
138 | - $application->add(Server::get(State::class)); |
|
134 | + $application->add(Server::get(Cleanup::class)); |
|
135 | + $application->add(Server::get(Enforce::class)); |
|
136 | + $application->add(Server::get(Command\TwoFactorAuth\Enable::class)); |
|
137 | + $application->add(Server::get(Command\TwoFactorAuth\Disable::class)); |
|
138 | + $application->add(Server::get(State::class)); |
|
139 | 139 | |
140 | - $application->add(Server::get(Mode::class)); |
|
141 | - $application->add(Server::get(Job::class)); |
|
142 | - $application->add(Server::get(ListCommand::class)); |
|
143 | - $application->add(Server::get(Delete::class)); |
|
144 | - $application->add(Server::get(JobWorker::class)); |
|
140 | + $application->add(Server::get(Mode::class)); |
|
141 | + $application->add(Server::get(Job::class)); |
|
142 | + $application->add(Server::get(ListCommand::class)); |
|
143 | + $application->add(Server::get(Delete::class)); |
|
144 | + $application->add(Server::get(JobWorker::class)); |
|
145 | 145 | |
146 | - $application->add(Server::get(Test::class)); |
|
146 | + $application->add(Server::get(Test::class)); |
|
147 | 147 | |
148 | - $application->add(Server::get(DeleteConfig::class)); |
|
149 | - $application->add(Server::get(GetConfig::class)); |
|
150 | - $application->add(Server::get(SetConfig::class)); |
|
151 | - $application->add(Server::get(Import::class)); |
|
152 | - $application->add(Server::get(ListConfigs::class)); |
|
153 | - $application->add(Server::get(Preset::class)); |
|
154 | - $application->add(Server::get(Command\Config\System\DeleteConfig::class)); |
|
155 | - $application->add(Server::get(Command\Config\System\GetConfig::class)); |
|
156 | - $application->add(Server::get(Command\Config\System\SetConfig::class)); |
|
148 | + $application->add(Server::get(DeleteConfig::class)); |
|
149 | + $application->add(Server::get(GetConfig::class)); |
|
150 | + $application->add(Server::get(SetConfig::class)); |
|
151 | + $application->add(Server::get(Import::class)); |
|
152 | + $application->add(Server::get(ListConfigs::class)); |
|
153 | + $application->add(Server::get(Preset::class)); |
|
154 | + $application->add(Server::get(Command\Config\System\DeleteConfig::class)); |
|
155 | + $application->add(Server::get(Command\Config\System\GetConfig::class)); |
|
156 | + $application->add(Server::get(Command\Config\System\SetConfig::class)); |
|
157 | 157 | |
158 | - $application->add(Server::get(File::class)); |
|
159 | - $application->add(Server::get(Space::class)); |
|
160 | - $application->add(Server::get(Storage::class)); |
|
161 | - $application->add(Server::get(Storages::class)); |
|
158 | + $application->add(Server::get(File::class)); |
|
159 | + $application->add(Server::get(Space::class)); |
|
160 | + $application->add(Server::get(Storage::class)); |
|
161 | + $application->add(Server::get(Storages::class)); |
|
162 | 162 | |
163 | - $application->add(Server::get(ConvertType::class)); |
|
164 | - $application->add(Server::get(ConvertMysqlToMB4::class)); |
|
165 | - $application->add(Server::get(ConvertFilecacheBigInt::class)); |
|
166 | - $application->add(Server::get(AddMissingColumns::class)); |
|
167 | - $application->add(Server::get(AddMissingIndices::class)); |
|
168 | - $application->add(Server::get(AddMissingPrimaryKeys::class)); |
|
169 | - $application->add(Server::get(ExpectedSchema::class)); |
|
170 | - $application->add(Server::get(ExportSchema::class)); |
|
163 | + $application->add(Server::get(ConvertType::class)); |
|
164 | + $application->add(Server::get(ConvertMysqlToMB4::class)); |
|
165 | + $application->add(Server::get(ConvertFilecacheBigInt::class)); |
|
166 | + $application->add(Server::get(AddMissingColumns::class)); |
|
167 | + $application->add(Server::get(AddMissingIndices::class)); |
|
168 | + $application->add(Server::get(AddMissingPrimaryKeys::class)); |
|
169 | + $application->add(Server::get(ExpectedSchema::class)); |
|
170 | + $application->add(Server::get(ExportSchema::class)); |
|
171 | 171 | |
172 | - $application->add(Server::get(GenerateMetadataCommand::class)); |
|
173 | - $application->add(Server::get(PreviewCommand::class)); |
|
174 | - if ($config->getSystemValueBool('debug', false)) { |
|
175 | - $application->add(Server::get(StatusCommand::class)); |
|
176 | - $application->add(Server::get(MigrateCommand::class)); |
|
177 | - $application->add(Server::get(GenerateCommand::class)); |
|
178 | - $application->add(Server::get(ExecuteCommand::class)); |
|
179 | - } |
|
172 | + $application->add(Server::get(GenerateMetadataCommand::class)); |
|
173 | + $application->add(Server::get(PreviewCommand::class)); |
|
174 | + if ($config->getSystemValueBool('debug', false)) { |
|
175 | + $application->add(Server::get(StatusCommand::class)); |
|
176 | + $application->add(Server::get(MigrateCommand::class)); |
|
177 | + $application->add(Server::get(GenerateCommand::class)); |
|
178 | + $application->add(Server::get(ExecuteCommand::class)); |
|
179 | + } |
|
180 | 180 | |
181 | - $application->add(Server::get(Command\Encryption\Disable::class)); |
|
182 | - $application->add(Server::get(Command\Encryption\Enable::class)); |
|
183 | - $application->add(Server::get(ListModules::class)); |
|
184 | - $application->add(Server::get(SetDefaultModule::class)); |
|
185 | - $application->add(Server::get(Command\Encryption\Status::class)); |
|
186 | - $application->add(Server::get(EncryptAll::class)); |
|
187 | - $application->add(Server::get(DecryptAll::class)); |
|
181 | + $application->add(Server::get(Command\Encryption\Disable::class)); |
|
182 | + $application->add(Server::get(Command\Encryption\Enable::class)); |
|
183 | + $application->add(Server::get(ListModules::class)); |
|
184 | + $application->add(Server::get(SetDefaultModule::class)); |
|
185 | + $application->add(Server::get(Command\Encryption\Status::class)); |
|
186 | + $application->add(Server::get(EncryptAll::class)); |
|
187 | + $application->add(Server::get(DecryptAll::class)); |
|
188 | 188 | |
189 | - $application->add(Server::get(Manage::class)); |
|
190 | - $application->add(Server::get(Command\Log\File::class)); |
|
189 | + $application->add(Server::get(Manage::class)); |
|
190 | + $application->add(Server::get(Command\Log\File::class)); |
|
191 | 191 | |
192 | - $application->add(Server::get(ChangeKeyStorageRoot::class)); |
|
193 | - $application->add(Server::get(ShowKeyStorageRoot::class)); |
|
194 | - $application->add(Server::get(MigrateKeyStorage::class)); |
|
192 | + $application->add(Server::get(ChangeKeyStorageRoot::class)); |
|
193 | + $application->add(Server::get(ShowKeyStorageRoot::class)); |
|
194 | + $application->add(Server::get(MigrateKeyStorage::class)); |
|
195 | 195 | |
196 | - $application->add(Server::get(DataFingerprint::class)); |
|
197 | - $application->add(Server::get(UpdateDB::class)); |
|
198 | - $application->add(Server::get(UpdateJS::class)); |
|
199 | - $application->add(Server::get(Command\Maintenance\Mode::class)); |
|
200 | - $application->add(Server::get(UpdateHtaccess::class)); |
|
201 | - $application->add(Server::get(UpdateTheme::class)); |
|
196 | + $application->add(Server::get(DataFingerprint::class)); |
|
197 | + $application->add(Server::get(UpdateDB::class)); |
|
198 | + $application->add(Server::get(UpdateJS::class)); |
|
199 | + $application->add(Server::get(Command\Maintenance\Mode::class)); |
|
200 | + $application->add(Server::get(UpdateHtaccess::class)); |
|
201 | + $application->add(Server::get(UpdateTheme::class)); |
|
202 | 202 | |
203 | - $application->add(Server::get(Upgrade::class)); |
|
204 | - $application->add(Server::get(Repair::class)); |
|
205 | - $application->add(Server::get(RepairShareOwnership::class)); |
|
203 | + $application->add(Server::get(Upgrade::class)); |
|
204 | + $application->add(Server::get(Repair::class)); |
|
205 | + $application->add(Server::get(RepairShareOwnership::class)); |
|
206 | 206 | |
207 | - $application->add(Server::get(Command\Preview\Cleanup::class)); |
|
208 | - $application->add(Server::get(Generate::class)); |
|
209 | - $application->add(Server::get(Command\Preview\Repair::class)); |
|
210 | - $application->add(Server::get(ResetRenderedTexts::class)); |
|
207 | + $application->add(Server::get(Command\Preview\Cleanup::class)); |
|
208 | + $application->add(Server::get(Generate::class)); |
|
209 | + $application->add(Server::get(Command\Preview\Repair::class)); |
|
210 | + $application->add(Server::get(ResetRenderedTexts::class)); |
|
211 | 211 | |
212 | - $application->add(Server::get(Add::class)); |
|
213 | - $application->add(Server::get(Command\User\Delete::class)); |
|
214 | - $application->add(Server::get(Command\User\Disable::class)); |
|
215 | - $application->add(Server::get(Command\User\Enable::class)); |
|
216 | - $application->add(Server::get(LastSeen::class)); |
|
217 | - $application->add(Server::get(Report::class)); |
|
218 | - $application->add(Server::get(ResetPassword::class)); |
|
219 | - $application->add(Server::get(Setting::class)); |
|
220 | - $application->add(Server::get(Profile::class)); |
|
221 | - $application->add(Server::get(Command\User\ListCommand::class)); |
|
222 | - $application->add(Server::get(ClearGeneratedAvatarCacheCommand::class)); |
|
223 | - $application->add(Server::get(Info::class)); |
|
224 | - $application->add(Server::get(SyncAccountDataCommand::class)); |
|
225 | - $application->add(Server::get(Command\User\AuthTokens\Add::class)); |
|
226 | - $application->add(Server::get(Command\User\AuthTokens\ListCommand::class)); |
|
227 | - $application->add(Server::get(Command\User\AuthTokens\Delete::class)); |
|
228 | - $application->add(Server::get(Verify::class)); |
|
229 | - $application->add(Server::get(Welcome::class)); |
|
212 | + $application->add(Server::get(Add::class)); |
|
213 | + $application->add(Server::get(Command\User\Delete::class)); |
|
214 | + $application->add(Server::get(Command\User\Disable::class)); |
|
215 | + $application->add(Server::get(Command\User\Enable::class)); |
|
216 | + $application->add(Server::get(LastSeen::class)); |
|
217 | + $application->add(Server::get(Report::class)); |
|
218 | + $application->add(Server::get(ResetPassword::class)); |
|
219 | + $application->add(Server::get(Setting::class)); |
|
220 | + $application->add(Server::get(Profile::class)); |
|
221 | + $application->add(Server::get(Command\User\ListCommand::class)); |
|
222 | + $application->add(Server::get(ClearGeneratedAvatarCacheCommand::class)); |
|
223 | + $application->add(Server::get(Info::class)); |
|
224 | + $application->add(Server::get(SyncAccountDataCommand::class)); |
|
225 | + $application->add(Server::get(Command\User\AuthTokens\Add::class)); |
|
226 | + $application->add(Server::get(Command\User\AuthTokens\ListCommand::class)); |
|
227 | + $application->add(Server::get(Command\User\AuthTokens\Delete::class)); |
|
228 | + $application->add(Server::get(Verify::class)); |
|
229 | + $application->add(Server::get(Welcome::class)); |
|
230 | 230 | |
231 | - $application->add(Server::get(Command\Group\Add::class)); |
|
232 | - $application->add(Server::get(Command\Group\Delete::class)); |
|
233 | - $application->add(Server::get(Command\Group\ListCommand::class)); |
|
234 | - $application->add(Server::get(AddUser::class)); |
|
235 | - $application->add(Server::get(RemoveUser::class)); |
|
236 | - $application->add(Server::get(Command\Group\Info::class)); |
|
231 | + $application->add(Server::get(Command\Group\Add::class)); |
|
232 | + $application->add(Server::get(Command\Group\Delete::class)); |
|
233 | + $application->add(Server::get(Command\Group\ListCommand::class)); |
|
234 | + $application->add(Server::get(AddUser::class)); |
|
235 | + $application->add(Server::get(RemoveUser::class)); |
|
236 | + $application->add(Server::get(Command\Group\Info::class)); |
|
237 | 237 | |
238 | - $application->add(Server::get(Command\SystemTag\ListCommand::class)); |
|
239 | - $application->add(Server::get(Command\SystemTag\Delete::class)); |
|
240 | - $application->add(Server::get(Command\SystemTag\Add::class)); |
|
241 | - $application->add(Server::get(Edit::class)); |
|
238 | + $application->add(Server::get(Command\SystemTag\ListCommand::class)); |
|
239 | + $application->add(Server::get(Command\SystemTag\Delete::class)); |
|
240 | + $application->add(Server::get(Command\SystemTag\Add::class)); |
|
241 | + $application->add(Server::get(Edit::class)); |
|
242 | 242 | |
243 | - $application->add(Server::get(ListCertificates::class)); |
|
244 | - $application->add(Server::get(ExportCertificates::class)); |
|
245 | - $application->add(Server::get(ImportCertificate::class)); |
|
246 | - $application->add(Server::get(RemoveCertificate::class)); |
|
247 | - $application->add(Server::get(BruteforceAttempts::class)); |
|
248 | - $application->add(Server::get(BruteforceResetAttempts::class)); |
|
249 | - $application->add(Server::get(SetupChecks::class)); |
|
250 | - $application->add(Server::get(Get::class)); |
|
243 | + $application->add(Server::get(ListCertificates::class)); |
|
244 | + $application->add(Server::get(ExportCertificates::class)); |
|
245 | + $application->add(Server::get(ImportCertificate::class)); |
|
246 | + $application->add(Server::get(RemoveCertificate::class)); |
|
247 | + $application->add(Server::get(BruteforceAttempts::class)); |
|
248 | + $application->add(Server::get(BruteforceResetAttempts::class)); |
|
249 | + $application->add(Server::get(SetupChecks::class)); |
|
250 | + $application->add(Server::get(Get::class)); |
|
251 | 251 | |
252 | - $application->add(Server::get(GetCommand::class)); |
|
253 | - $application->add(Server::get(EnabledCommand::class)); |
|
254 | - $application->add(Server::get(Command\TaskProcessing\ListCommand::class)); |
|
255 | - $application->add(Server::get(Statistics::class)); |
|
252 | + $application->add(Server::get(GetCommand::class)); |
|
253 | + $application->add(Server::get(EnabledCommand::class)); |
|
254 | + $application->add(Server::get(Command\TaskProcessing\ListCommand::class)); |
|
255 | + $application->add(Server::get(Statistics::class)); |
|
256 | 256 | |
257 | - $application->add(Server::get(RedisCommand::class)); |
|
258 | - $application->add(Server::get(DistributedClear::class)); |
|
259 | - $application->add(Server::get(DistributedDelete::class)); |
|
260 | - $application->add(Server::get(DistributedGet::class)); |
|
261 | - $application->add(Server::get(DistributedSet::class)); |
|
257 | + $application->add(Server::get(RedisCommand::class)); |
|
258 | + $application->add(Server::get(DistributedClear::class)); |
|
259 | + $application->add(Server::get(DistributedDelete::class)); |
|
260 | + $application->add(Server::get(DistributedGet::class)); |
|
261 | + $application->add(Server::get(DistributedSet::class)); |
|
262 | 262 | } else { |
263 | - $application->add(Server::get(Command\Maintenance\Install::class)); |
|
263 | + $application->add(Server::get(Command\Maintenance\Install::class)); |
|
264 | 264 | } |
@@ -18,54 +18,54 @@ |
||
18 | 18 | use Symfony\Component\Console\Output\OutputInterface; |
19 | 19 | |
20 | 20 | class Preset extends Base { |
21 | - public function __construct( |
|
22 | - private readonly IConfig $config, |
|
23 | - private readonly ConfigManager $configManager, |
|
24 | - ) { |
|
25 | - parent::__construct(); |
|
26 | - } |
|
21 | + public function __construct( |
|
22 | + private readonly IConfig $config, |
|
23 | + private readonly ConfigManager $configManager, |
|
24 | + ) { |
|
25 | + parent::__construct(); |
|
26 | + } |
|
27 | 27 | |
28 | - protected function configure() { |
|
29 | - parent::configure(); |
|
30 | - $this->setName('config:preset') |
|
31 | - ->setDescription('Select a config preset') |
|
32 | - ->addArgument('preset', InputArgument::OPTIONAL, 'Preset to use for all unset config values', '') |
|
33 | - ->addOption('list', '', InputOption::VALUE_NONE, 'display available preset'); |
|
34 | - } |
|
28 | + protected function configure() { |
|
29 | + parent::configure(); |
|
30 | + $this->setName('config:preset') |
|
31 | + ->setDescription('Select a config preset') |
|
32 | + ->addArgument('preset', InputArgument::OPTIONAL, 'Preset to use for all unset config values', '') |
|
33 | + ->addOption('list', '', InputOption::VALUE_NONE, 'display available preset'); |
|
34 | + } |
|
35 | 35 | |
36 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
37 | - if ($input->getOption('list')) { |
|
38 | - $this->getEnum('', $list); |
|
39 | - $this->writeArrayInOutputFormat($input, $output, $list); |
|
40 | - return self::SUCCESS; |
|
41 | - } |
|
36 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
37 | + if ($input->getOption('list')) { |
|
38 | + $this->getEnum('', $list); |
|
39 | + $this->writeArrayInOutputFormat($input, $output, $list); |
|
40 | + return self::SUCCESS; |
|
41 | + } |
|
42 | 42 | |
43 | - $presetArg = $input->getArgument('preset'); |
|
44 | - if ($presetArg !== '') { |
|
45 | - $preset = $this->getEnum($presetArg, $list); |
|
46 | - if ($preset === null) { |
|
47 | - $output->writeln('<error>Invalid preset: ' . $presetArg . '</error>'); |
|
48 | - $output->writeln('Available presets: ' . implode(', ', $list)); |
|
49 | - return self::INVALID; |
|
50 | - } |
|
43 | + $presetArg = $input->getArgument('preset'); |
|
44 | + if ($presetArg !== '') { |
|
45 | + $preset = $this->getEnum($presetArg, $list); |
|
46 | + if ($preset === null) { |
|
47 | + $output->writeln('<error>Invalid preset: ' . $presetArg . '</error>'); |
|
48 | + $output->writeln('Available presets: ' . implode(', ', $list)); |
|
49 | + return self::INVALID; |
|
50 | + } |
|
51 | 51 | |
52 | - $this->configManager->setLexiconPreset($preset); |
|
53 | - } |
|
52 | + $this->configManager->setLexiconPreset($preset); |
|
53 | + } |
|
54 | 54 | |
55 | - $current = ConfigLexiconPreset::tryFrom($this->config->getSystemValueInt(ConfigManager::PRESET_CONFIGKEY, 0)) ?? ConfigLexiconPreset::NONE; |
|
56 | - $this->writeArrayInOutputFormat($input, $output, [$current->name], 'current preset: '); |
|
57 | - return self::SUCCESS; |
|
58 | - } |
|
55 | + $current = ConfigLexiconPreset::tryFrom($this->config->getSystemValueInt(ConfigManager::PRESET_CONFIGKEY, 0)) ?? ConfigLexiconPreset::NONE; |
|
56 | + $this->writeArrayInOutputFormat($input, $output, [$current->name], 'current preset: '); |
|
57 | + return self::SUCCESS; |
|
58 | + } |
|
59 | 59 | |
60 | - private function getEnum(string $name, ?array &$list = null): ?ConfigLexiconPreset { |
|
61 | - $list = []; |
|
62 | - foreach (ConfigLexiconPreset::cases() as $case) { |
|
63 | - $list[] = $case->name; |
|
64 | - if (strtolower($case->name) === strtolower($name)) { |
|
65 | - return $case; |
|
66 | - } |
|
67 | - } |
|
60 | + private function getEnum(string $name, ?array &$list = null): ?ConfigLexiconPreset { |
|
61 | + $list = []; |
|
62 | + foreach (ConfigLexiconPreset::cases() as $case) { |
|
63 | + $list[] = $case->name; |
|
64 | + if (strtolower($case->name) === strtolower($name)) { |
|
65 | + return $case; |
|
66 | + } |
|
67 | + } |
|
68 | 68 | |
69 | - return null; |
|
70 | - } |
|
69 | + return null; |
|
70 | + } |
|
71 | 71 | } |
@@ -44,8 +44,8 @@ |
||
44 | 44 | if ($presetArg !== '') { |
45 | 45 | $preset = $this->getEnum($presetArg, $list); |
46 | 46 | if ($preset === null) { |
47 | - $output->writeln('<error>Invalid preset: ' . $presetArg . '</error>'); |
|
48 | - $output->writeln('Available presets: ' . implode(', ', $list)); |
|
47 | + $output->writeln('<error>Invalid preset: '.$presetArg.'</error>'); |
|
48 | + $output->writeln('Available presets: '.implode(', ', $list)); |
|
49 | 49 | return self::INVALID; |
50 | 50 | } |
51 | 51 |