plugin-lifecycle

Add or modify service lifecycle handlers in the backups module.

4|1|Updated Jun 7, 2017
One-click install
npx skills add https://github.com/myadmin-plugins/backups-module --skill plugin-lifecycle-myadmin-plugins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plugin-lifecycle
Source: https://github.com/myadmin-plugins/backups-module/tree/main/.claude/skills/plugin-lifecycle
Command: npx skills add https://github.com/myadmin-plugins/backups-module --skill plugin-lifecycle-myadmin-plugins

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adds or modifies service lifecycle handlers (enable, reactivate, disable, terminate) inside loadProcessing in src/Plugin.php. Use when user says 'add lifecycle handler', 'handle termination', 'reactivate service', 'disable service', or modifies service state logic in the backups module. Covers Acronis (type 10665), DirectAdmin, and generic backend branching with correct DB updates, history tracking, and admin email notifications. Do NOT use for settings UI changes (getSettings) or hook registration (getHooks).

Core Features & Use Cases

  • Add and chain lifecycle closures (setEnable, setReactivate, setDisable, setTerminate) inside loadProcessing so they always end with ->register().
  • Backend branching supports Acronis (10665), DirectAdmin storage, and generic backends with proper DB updates, queue/history entries, and admin notifications.
  • History and admin notifications accompany state changes and pending actions.

Quick Start

Open the Plugin source and implement the four lifecycle handlers in loadProcessing(), ensuring the closure variables are declared and the final call is ->register().

Frequently Asked Questions about plugin-lifecycle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add service lifecycle handlers for enable, disable, and terminate events in my backend plugin?

To add service lifecycle handlers, implement setEnable, setReactivate, setDisable, and setTerminate closures inside loadProcessing, ensuring the final call in the chain is ->register() to activate the backend workflows.

Does the plugin lifecycle handler support branching for Acronis and DirectAdmin storage backends?

Yes, the lifecycle handler enforces strict backend branching for Acronis type 10665, DirectAdmin storage, and generic backends, applying correct database updates and history logging for each platform.

What is the correct way to reactivate a suspended service and log the state change in the backups module?

Reactivate a service using the setReactivate closure within loadProcessing, which triggers the correct database state update, records a history queue entry, and sends an admin email notification.

Can I use this lifecycle handler approach to modify settings UI or register hooks in my plugin?

No, this approach is not for modifying settings UI via getSettings or registering hooks via getHooks. It strictly handles enable, reactivate, disable, and terminate service state workflows in the backups module.

Why are my service termination workflows failing to log history or send admin notifications?

Service termination workflows fail to log history or send notifications if the setTerminate closure is not properly chained and concluded with ->register(), which breaks the required database state updates and admin email alerts.