So?
Code:
// src/Cron/RequestCache.php
namespace App\Cron;
use Contao\CoreBundle\ServiceAnnotation\CronJob;
use Doctrine\DBAL\Connection;
/**
* @CronJob("hourly")
*/
class RequestCache
{
private Connection $connection;
public function __construct(Connection $connection)
{
$this->connection = $connection;
}
public function __invoke(): void
{
// Leeren des Isotope-Request-Caches
$this->connection->executeStatement("TRUNCATE TABLE tl_iso_requestcache");
}
}
Und muss ich dann in der composer.json das hier ergänzen (den Eintrag gibt es aktuell nicht):
Code:
"autoload": {
"psr-4": {
"App\\": "src/"
}
}
Aktuell steht da:
Code:
"require-dev": {
"contao/easy-coding-standard": "^5.3"
},
"extra": {
"contao-component-dir": "assets"
},
"scripts": {
"post-install-cmd": [
"@php vendor/bin/contao-setup --ansi"
],
"post-update-cmd": [
"Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
]
},
"config": {
"allow-plugins": {
"contao-components/installer": true,
"contao/manager-plugin": true,
"contao-community-alliance/composer-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}