docs: Port "Commands" page from legacy dev docs into RST (7.2)#584
docs: Port "Commands" page from legacy dev docs into RST (7.2)#584promptless-for-oss wants to merge 1 commit into
Conversation
Port the plugin_miscellaneous/commands page from the legacy Markdown docs (source/includes/_plugin_misc_commands.md) into RST, updating the content for Mautic 7.x: modern AsCommand attribute, autowired command registration, and the current ModeratedCommand locking API. Refs mautic#395, mautic#394
| @@ -1,14 +1,78 @@ | |||
| Commands | |||
There was a problem hiding this comment.
Ported the Commands page content from the legacy Markdown source _plugin_misc_commands.md, which documented adding CLI commands via Symfony's Console component and moderating them with ModeratedCommand (checkRunStatus()/completeRun()).
Source: https://github.com/mautic/developer-documentation/blob/main/source/includes/_plugin_misc_commands.md
| Moderated commands | ||
| ================== | ||
|
|
||
| Some commands shouldn't run more than one instance at a time, such as those that process queues or send scheduled Broadcasts. Extend ``Mautic\CoreBundle\Command\ModeratedCommand`` to lock the command so that only a single instance runs concurrently. Call ``checkRunStatus()`` at the start of ``execute()`` to acquire the lock, then call ``completeRun()`` once the work finishes to release it. |
There was a problem hiding this comment.
Updated the ModeratedCommand guidance against the current 7.x implementation: ModeratedCommand adds the --bypass-locking, --timeout, and --lock_mode options, locks on the command name, and checkRunStatus() accepts a $moderationKey third argument for per-target locking.
Source: https://github.com/mautic/mautic/blob/7.x/app/bundles/CoreBundle/Command/ModeratedCommand.php
Open this suggestion in Promptless to view citations and reasoning process
Ports the plugin_miscellaneous/commands page from the legacy Markdown docs into RST on the 7.2 branch, replacing the placeholder. Content is updated for Mautic 7.x: registering console commands via autowiring/autoconfiguration, the modern #[AsCommand] attribute, and the current ModeratedCommand locking API (checkRunStatus/completeRun). Source: 7.1 porting issue #395 and parent 7.0 issue #394.
Trigger Events
blockedlabel is to set content, structure, and tone in one branch, then backport/cherry pick i...Tip: Enable auto-create PR in your Configuration to review suggestions directly in GitHub 🤖