Browse Source

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

experimental
Secret User 3 years 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());
$application->add(new \Epesi\Console\Develop\CreateModuleCommand());
$application->add(new \Epesi\Console\Develop\CreatePatchCommand());
$application->add(new \Epesi\Console\ShellCommand());
$application->add(new \Epesi\Console\RebuildAllCommand());
$application->run($input);

+ 33
- 0
console/RebuildAllCommand.php View File

@@ -0,0 +1,33 @@
<?php

/**
* Created by PhpStorm.
* User: pjedwabny
* Date: 08.09.15
* Time: 21:10
*/
namespace Epesi\Console;
use Cache;
use ModuleManager;
use Base_ThemeCommon;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class RebuildAllCommand extends Command
{
protected function configure(){
$this
->setName('rebuild:all')
->setDescription('Rebuild EPESI default theme and cache')
;
}
protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln('Rebuilding themes...');
Base_ThemeCommon::themeup();
$output->writeln('Theme rebuilt! Rebuilding cache...');
Cache::clear();
ModuleManager::create_common_cache();
$output->writeln('Cache rebuilt!');
}
}

Loading…
Cancel
Save