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 Sep 18, 2024
1 parent e9b90e9 commit 6a7206a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions _config/migration.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
Name: file-migration
---
# Remove the HTTPOutputHandler from the logger on the file migration.
# Remove the ErrorOutputHandler from the logger on the file migration.
# It logs a lot of >= NOTICE errors that pollute the output with backtrace.
SilverStripe\Core\Injector\Injector:
Psr\Log\LoggerInterface.quiet:
type: singleton
class: Monolog\Logger
constructor:
- "file-migration"
- "file-migration"
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\PolyExecution\PolyOutput;
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)
protected function execute(InputInterface $input, PolyOutput $output): int
{
$class = new InterventionBackend();
$class->getCache()->clear();

echo 'DONE';
return Command::SUCCESS;
}
}

0 comments on commit 6a7206a

Please sign in to comment.