Skip to content

docs: Port "Commands" page from legacy dev docs into RST (7.2)#584

Open
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/port-commands-page-7.2
Open

docs: Port "Commands" page from legacy dev docs into RST (7.2)#584
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/port-commands-page-7.2

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

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


Tip: Enable auto-create PR in your Configuration to review suggestions directly in GitHub 🤖

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant