You are here

class CacheRebuild in Automatic Updates 8

Cache rebuild command.

Hierarchy

  • class \Drupal\automatic_updates\Command\BaseCommand extends \Symfony\Component\Console\Command\Command

Expanded class hierarchy of CacheRebuild

File

src/Command/CacheRebuild.php, line 11

Namespace

Drupal\automatic_updates\Command
View source
class CacheRebuild extends BaseCommand {

  /**
   * {@inheritdoc}
   */
  protected function configure() {
    parent::configure();
    $this
      ->setName('cache:rebuild')
      ->setAliases([
      'cr, rebuild',
    ])
      ->setDescription('Rebuild a Drupal site and clear all its caches.');
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    parent::execute($input, $output);
    drupal_flush_all_caches();
    $output
      ->writeln('Cache rebuild complete.');
    return 0;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseCommand::$classLoader protected property The class loader.
BaseCommand::bootstrapDrupal protected function Bootstrap Drupal.
BaseCommand::__construct public function Constructs a new InstallCommand command.
CacheRebuild::configure protected function Configures the current command. Overrides BaseCommand::configure
CacheRebuild::execute protected function Executes the current command. Overrides BaseCommand::execute