From c6d84d665699dd453b3bec43c3f125b9534d7fb0 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 28 Aug 2024 17:14:57 +1200 Subject: [PATCH] API Update API to reflect changes to CLI interaction --- .../InterventionBackendCacheFlushTask.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Dev/Tasks/InterventionBackendCacheFlushTask.php b/src/Dev/Tasks/InterventionBackendCacheFlushTask.php index edbc67d9..eac0a9ae 100644 --- a/src/Dev/Tasks/InterventionBackendCacheFlushTask.php +++ b/src/Dev/Tasks/InterventionBackendCacheFlushTask.php @@ -4,27 +4,25 @@ use SilverStripe\Assets\InterventionBackend; use SilverStripe\Dev\BuildTask; +use SilverStripe\Dev\HybridExecution\HybridOutput; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; /** * A task to manually flush InterventionBackend cache */ class InterventionBackendCacheFlushTask extends BuildTask { - private static $segment = 'InterventionBackendCacheFlushTask'; + protected static ?string $commandName = 'InterventionBackendCacheFlushTask'; - protected $title = 'Clear InterventionBackend cache'; + protected string $title = 'Clear InterventionBackend cache'; - protected $description = "Clears caches for InterventionBackend"; + protected static ?string $description = 'Clears caches for InterventionBackend'; - /** - * @param \SilverStripe\Control\HTTPRequest $request - * @throws \ReflectionException - */ - public function run($request) + public function run(InputInterface $input, HybridOutput $output): int { $class = new InterventionBackend(); $class->getCache()->clear(); - - echo 'DONE'; + return Command::SUCCESS; } }