tome-8.x-1.x-dev/modules/tome_static/modules/tome_static_super_cache/src/Commands/TomeSuperCacheRebuildCommand.php

modules/tome_static/modules/tome_static_super_cache/src/Commands/TomeSuperCacheRebuildCommand.php
<?php

namespace Drupal\tome_static_super_cache\Commands;

use Drupal\tome_base\CommandBase;
use Drupal\tome_static_super_cache\SuperStaticCache;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Contains the tome:super-cache-rebuild command.
 */
class TomeSuperCacheRebuildCommand extends CommandBase {

  /**
   * {@inheritdoc}
   */
  protected function configure() {
    $this->setName('tome:super-cache-rebuild')
      ->setAliases(['tscr'])
      ->setDescription('Rebuilds cache without conditions.');
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output): int {
    $GLOBALS[SuperStaticCache::FULL_REBUILD_KEY] = TRUE;
    drupal_flush_all_caches();
    $this->io()->success('Full cache rebuild complete.');
    return 0;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc