TYPO3 v13 compatibility, DI modernization, and new crontab:list / crontab:show commands - #26
Open
stigfaerch wants to merge 8 commits into
Open
TYPO3 v13 compatibility, DI modernization, and new crontab:list / crontab:show commands#26stigfaerch wants to merge 8 commits into
stigfaerch wants to merge 8 commits into
Conversation
Inject ConnectionPool instead of Connection since Symfony cannot autowire Connection (its constructor requires an array $params). Resolve the scheduled-table connection in the constructor body. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
List all configured tasks grouped by group, showing executor type (Command/Scheduler/Script), scheduled status and next execution time. For Command tasks the title column shows the Symfony command's own description, truncated to 60 characters. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25
Summary
This branch makes the extension compatible with TYPO3 v13.4 and raises the version to 1.0.0-dev. Support for TYPO3 v11/v12 is dropped. Along the way, the codebase is modernized (native DI, typed properties, PHP 8.2+), the backend module is migrated to the v13 module APIs, and two new CLI commands are added.
Breaking changes
dragonmantank/cron-expression^3.0 (previously ^2.3).ext_tables.php(legacy module registration and v11 scheduler-module hiding) is deleted; module registration now relies solely onConfiguration/Backend/Modules.php, and hiding the scheduler module solely on theBeforeModuleCreationEventlistener.Helhum\TYPO3\Crontab\Crontabno longer has an optional constructor argument with amakeInstancefallback: it now requiresTaskRepositoryandConnectionPoolvia DI. Code instantiating it manually must be updated.TaskExecutorinterface gains agetArguments(): arrayrequirement implemented by all shipped executors (Command/Scheduler/Script); custom executors must implement it.Backend module migration to v13 APIs
ModuleTemplate::assignMultiple()+renderResponse()instead of the removed$this->view/setContent()/renderContent()flow.Resources/Private/Layouts/Module.htmlreplacesDefault.html, rendering the doc header, flash messages, and module body the way v13 expects.Configuration/JavaScriptModules.phpimport map (@helhum/crontab/), andf:be.pageRenderernow usesincludeJavaScriptModules.Resources/Public/JavaScript/Scheduler.js(190 lines of jQuery/RequireJS code, mostly copied from EXT:scheduler and unused here) is replaced by a small vanilla-JS ES module (scheduler.js) that only implements the per-group "check all" toggle — collapse, tooltips, and modals are handled by core/Bootstrap 5.data-bs-*attributes,text-bg-*badges,float-end).ExpressionViewHelperdrops the removedCompileWithRenderStatictrait in favor of a plainrender()method.Dependency injection / autowiring fixes
Crontabservice is properly autowired: it now injectsConnectionPool(Symfony DI cannot autowireConnectiondirectly, since its constructor requires an array of params) and resolves the connection in the constructor body.CrontabCommandandCrontabScheduleCommandget their dependencies (Crontab,TaskRepository) via constructor injection instead ofGeneralUtility::makeInstance()insideexecute().New features
crontab:list— lists all configured tasks grouped by task group, showing identifier, executor type (Command/Scheduler/Script), title, arguments, scheduled state, and next execution time. For command tasks the title falls back to the Symfony command's own description.crontab:show <identifier>— shows all details for a single task (group, type, cron expression, next due/next execution, multiple-execution and retry flags, progress, executor class, and full argument list).Other fixes and modernization
Crontab::dueTasks()usesfetchAssociative()(the Doctrine DBALfetch()method no longer exists).Type $x = null) converted to explicit?Type $x = null(deprecated as of PHP 8.4).SchedulerTaskRepository::$optionValuesis now declared explicitly (it was previously created as a dynamic property, deprecated since PHP 8.2).@var-docblock properties replaced with native typed properties across commands, events, executors, task definitions, and the process manager; constructor property promotion andmatch()used where appropriate.ext_emconf.phpcleaned up (removed long-obsoleteuploadfolder,createDirs,clearCacheOnLoadkeys); version set to 1.0.0-dev, constrainttypo3 13.4.0-13.4.99.friendsofphp/php-cs-fixeradded as dev dependency.Testing
Running in production-mirroring TYPO3 v13.4 instances (MSP multisite platform): worker loop (
crontab:execute) with idle sleep, task scheduling/removal, the backend module (list, toggle, run-immediately, terminate, delete), and the newcrontab:list/crontab:showcommands.🤖 Generated with Claude Code