Skip to content

Commit

Permalink
API Update API to reflect changes to CLI interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 28, 2024
1 parent 85dd0e1 commit c6d84d6
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Dev/Tasks/InterventionBackendCacheFlushTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit c6d84d6

Please sign in to comment.