Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Update API to reflect changes to CLI interaction #635

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading