Вход Регистрация
Файл: concrete5.7.5.6/concrete/src/Console/Command/ClearCacheCommand.php
Строк: 49
<?php
namespace ConcreteCoreConsoleCommand;

use 
SymfonyComponentConsoleCommandCommand;
use 
SymfonyComponentConsoleInputInputInterface;
use 
SymfonyComponentConsoleOutputOutputInterface;
use 
Core;
use 
Exception;

class 
ClearCacheCommand extends Command
{
    protected function 
configure()
    {
        
$this
            
->setName('c5:clear-cache')
            ->
setDescription('Clear the concrete5 cache')
            ->
setHelp(<<<EOT
Returns codes:
  0 operation completed successfully
  1 errors occurred
EOT
            )
       ;
    }

    protected function 
execute(InputInterface $inputOutputInterface $output)
    {
        
$rc 0;
        try {
            
$output->write('Clearing the concrete5 cache... ');
            
$cms Core::make('app');
            
$cms->clearCaches();
            
$output->writeln('<info>done.</info>');
        } catch (
Exception $x) {
            
$output->writeln('<error>'.$x->getMessage().'</error>');
            
$rc 1;
        }

        return 
$rc;
    }
}
Онлайн: 0
Реклама