events/Classes/Command/CleanupCommand.php

30 lines
816 B
PHP
Raw Normal View History

2019-08-12 07:43:37 +02:00
<?php
namespace Wrm\Events\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Core\Bootstrap;
2019-08-13 11:17:34 +02:00
use TYPO3\CMS\Extbase\Object\ObjectManager;
2019-08-12 07:43:37 +02:00
2019-08-13 11:17:34 +02:00
use Wrm\Events\Service\CleanupService;
2019-08-12 07:43:37 +02:00
2019-08-13 11:17:34 +02:00
class CleanupCommand extends Command {
2019-08-12 07:43:37 +02:00
public function configure()
{
$this->setDescription('Cleanup Events');
$this->setHelp('Events are cleaned up');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
Bootstrap::initializeBackendAuthentication();
2019-08-13 11:17:34 +02:00
return GeneralUtility::makeInstance(ObjectManager::class)
->get(CleanupService::class)
->doClean();
2019-08-12 07:43:37 +02:00
}
}