Browse Source

[update] added rebuild:all command for console.php

Secret User 1 year ago
parent
commit
fb85ae28e3
2 changed files with 34 additions and 0 deletions
  1. 1
    0
      console.php
  2. 33
    0
      console/RebuildAllCommand.php

+ 1
- 0
console.php View File

@@ -42,4 +42,5 @@ $application->add(new \Epesi\Console\Demo\GenerateContactsCommand());
42 42
 $application->add(new \Epesi\Console\Develop\CreateModuleCommand());
43 43
 $application->add(new \Epesi\Console\Develop\CreatePatchCommand());
44 44
 $application->add(new \Epesi\Console\ShellCommand());
45
+$application->add(new \Epesi\Console\RebuildAllCommand());
45 46
 $application->run($input);

+ 33
- 0
console/RebuildAllCommand.php View File

@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+/**
4
+ * Created by PhpStorm.
5
+ * User: pjedwabny
6
+ * Date: 08.09.15
7
+ * Time: 21:10
8
+ */
9
+namespace Epesi\Console;
10
+use Cache;
11
+use ModuleManager;
12
+use Base_ThemeCommon;
13
+use Symfony\Component\Console\Command\Command;
14
+use Symfony\Component\Console\Input\InputInterface;
15
+use Symfony\Component\Console\Output\OutputInterface;
16
+
17
+class RebuildAllCommand extends Command
18
+{
19
+    protected function configure(){
20
+        $this
21
+            ->setName('rebuild:all')
22
+            ->setDescription('Rebuild EPESI default theme and cache')
23
+        ;
24
+    }
25
+    protected function execute(InputInterface $input, OutputInterface $output) {
26
+        $output->writeln('Rebuilding themes...');
27
+        Base_ThemeCommon::themeup();
28
+        $output->writeln('Theme rebuilt! Rebuilding cache...');
29
+        Cache::clear();
30
+        ModuleManager::create_common_cache();
31
+        $output->writeln('Cache rebuilt!');
32
+    }
33
+}

Loading…
Cancel
Save