From 142db19627c8dc37dd2695d99a7a788014936c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 24 Oct 2025 17:57:13 +0200 Subject: [PATCH] feat: integrate with scheduler bundle --- composer.json | 3 +- composer.lock | 146 +++++++++++++++++++++++- config/bundles.php | 1 + config/packages/zenstruck_schedule.yaml | 14 +++ symfony.lock | 3 + 5 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 config/packages/zenstruck_schedule.yaml diff --git a/composer.json b/composer.json index d218113..aba4bb8 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,8 @@ "twig/extra-bundle": "^2.12|^3.0", "twig/html-extra": "^3.15", "twig/intl-extra": "*", - "twig/twig": "^2.12|^3.0" + "twig/twig": "^2.12|^3.0", + "zenstruck/schedule-bundle": "^1.8" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 6118b5a..60e5e7a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "01564d521df6bf616616fcbba9454877", + "content-hash": "2cb7b927cf1a97b0e4473d0f51e1a094", "packages": [ { "name": "brick/math", @@ -1325,6 +1325,71 @@ }, "time": "2025-01-24T11:45:48+00:00" }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "8c784d071debd117328803d86b2097615b457500" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", + "reference": "8c784d071debd117328803d86b2097615b457500", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "webmozart/assert": "^1.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2024-10-09T13:47:03+00:00" + }, { "name": "egulias/email-validator", "version": "4.0.4", @@ -10443,6 +10508,85 @@ "source": "https://github.com/webmozarts/assert/tree/1.12.0" }, "time": "2025-10-20T12:43:39+00:00" + }, + { + "name": "zenstruck/schedule-bundle", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/zenstruck/schedule-bundle.git", + "reference": "c82f4d3e96566260796975a90a8d8075fca681c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zenstruck/schedule-bundle/zipball/c82f4d3e96566260796975a90a8d8075fca681c9", + "reference": "c82f4d3e96566260796975a90a8d8075fca681c9", + "shasum": "" + }, + "require": { + "dragonmantank/cron-expression": "^2.3|^3.0", + "php": ">=8.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0" + }, + "require-dev": { + "lorisleiva/cron-translator": "^0.1.0|^0.3.1|^0.4.0", + "matthiasnoback/symfony-dependency-injection-test": "^4.1|^5.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9.5", + "psr/log": "^1.1", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/mailer": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/notifier": "^5.4|^6.0|^7.0", + "symfony/phpunit-bridge": "^6.2|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" + }, + "suggest": { + "lorisleiva/cron-translator": "Displays human readable cron expression in schedule:list", + "symfony/http-client": "Allows usage of ping* extensions", + "symfony/lock": "Allows usage of withoutOverlapping and onSingleServer extensions", + "symfony/mailer": "Allows usage of email* extensions", + "symfony/notifier": "Allows usage of notify* extensions", + "symfony/process": "Allows usage of ProcessTask" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Zenstruck\\ScheduleBundle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Bond", + "email": "kevinbond@gmail.com" + } + ], + "description": "Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.", + "homepage": "https://github.com/zenstruck/schedule-bundle", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/zenstruck/schedule-bundle/issues", + "source": "https://github.com/zenstruck/schedule-bundle/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/kbond", + "type": "github" + } + ], + "time": "2025-04-27T22:34:07+00:00" } ], "packages-dev": [ diff --git a/config/bundles.php b/config/bundles.php index 5f23f18..bf83205 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -16,4 +16,5 @@ return [ Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], League\Bundle\OAuth2ServerBundle\LeagueOAuth2ServerBundle::class => ['all' => true], + Zenstruck\ScheduleBundle\ZenstruckScheduleBundle::class => ['all' => true], ]; diff --git a/config/packages/zenstruck_schedule.yaml b/config/packages/zenstruck_schedule.yaml new file mode 100644 index 0000000..dc1f295 --- /dev/null +++ b/config/packages/zenstruck_schedule.yaml @@ -0,0 +1,14 @@ +zenstruck_schedule: + timezone: Europe/Berlin + + mailer: + service: mailer + + schedule_extensions: + email_on_failure: + to: fromme@dreipunktnull.com + + tasks: + - task: app:cleanup:xml-dumps + frequency: '0 1 * * *' + description: "Removes outdated XML dumps of requests/responses to BPN API for debugging" diff --git a/symfony.lock b/symfony.lock index 1e549ea..7dd436e 100644 --- a/symfony.lock +++ b/symfony.lock @@ -362,5 +362,8 @@ }, "twig/extra-bundle": { "version": "v3.15.0" + }, + "zenstruck/schedule-bundle": { + "version": "v1.8.1" } }