Browse Source

Remove unused imports and improve some console commands

Adam Bukowski 3 years ago
parent
commit
1c55af81aa

+ 1
- 1
console/CacheRebuildCommand.php View File

@@ -8,7 +8,6 @@
8 8
  */
9 9
 namespace Epesi\Console;
10 10
 use Cache;
11
-use DB;
12 11
 use ModuleManager;
13 12
 use Symfony\Component\Console\Command\Command;
14 13
 use Symfony\Component\Console\Input\InputInterface;
@@ -24,5 +23,6 @@ class CacheRebuildCommand extends Command
24 23
     }
25 24
     protected function execute(InputInterface $input, OutputInterface $output) {
26 25
         Cache::clear();
26
+        ModuleManager::create_common_cache();
27 27
     }
28 28
 }

+ 9
- 4
console/Maintenance/MaintenanceStatusCommand.php View File

@@ -7,11 +7,8 @@
7 7
  * Time: 21:10
8 8
  */
9 9
 namespace Epesi\Console\Maintenance;
10
-use DB;
11 10
 use MaintenanceMode;
12
-use ModuleManager;
13 11
 use Symfony\Component\Console\Command\Command;
14
-use Symfony\Component\Console\Input\InputArgument;
15 12
 use Symfony\Component\Console\Input\InputInterface;
16 13
 use Symfony\Component\Console\Output\OutputInterface;
17 14
 
@@ -24,7 +21,15 @@ class MaintenanceStatusCommand extends Command
24 21
         ;
25 22
     }
26 23
     protected function execute(InputInterface $input, OutputInterface $output) {
27
-        $status = MaintenanceMode::is_on() ? '<fg=green>enabled</fg=green>' : '<fg=red>disabled</fg=red>';
24
+        $is_on = MaintenanceMode::is_on();
25
+        $status = $is_on ? '<fg=green>enabled</fg=green>' : '<fg=red>disabled</fg=red>';
28 26
         $output->writeln("Maintenance mode status: $status");
27
+        if ($is_on) {
28
+            MaintenanceMode::get_key();
29
+            global $maintenance_mode_key;
30
+            global $maintenance_mode_message;
31
+            $output->writeln("\tkey: $maintenance_mode_key");
32
+            $output->writeln("\tmessage: $maintenance_mode_message");
33
+        }
29 34
     }
30 35
 }

+ 0
- 3
console/ThemeRebuildCommand.php View File

@@ -8,9 +8,6 @@
8 8
  */
9 9
 namespace Epesi\Console;
10 10
 use Base_ThemeCommon;
11
-use Cache;
12
-use DB;
13
-use ModuleManager;
14 11
 use Symfony\Component\Console\Command\Command;
15 12
 use Symfony\Component\Console\Input\InputInterface;
16 13
 use Symfony\Component\Console\Output\OutputInterface;

Loading…
Cancel
Save