inc-function

Wraps KA API methods in a logged PHP function with try/catch for XML_RPC2_CurlException.

4|Updated May 25, 2017
One-click install
npx skills add https://github.com/myadmin-plugins/parallels-licensing --skill inc-function
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: inc-function
Source: https://github.com/myadmin-plugins/parallels-licensing/tree/main/.claude/skills/inc-function
Command: npx skills add https://github.com/myadmin-plugins/parallels-licensing --skill inc-function

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adds a new procedural function to src/parallels.inc.php wrapping a \Detain\Parallels\Parallels KA API method with the standard myadmin_log + request_log + try/catch pattern. Use when user says 'add function', 'new API call', 'call parallels method', or needs to expose a KA API method. Do NOT use for Plugin.php static event handlers or bin/ scripts.

Core Features & Use Cases

  • Generates a new parallels_<action>() function that calls a Detain\Parallels\Parallels method with no type hints or return types.
  • Wraps the call in a try/catch for XML_RPC2_CurlException and returns false on failure.
  • Logs activity via myadmin_log and request_log for both success and failure paths, using the 'licenses' module and 'parallels' service.
  • Avoids creating namespace declarations or static event handlers; targeted for simple procedural additions to src/parallels.inc.php.

Quick Start

Create a new parallels_<action>() wrapper for a KA API method following the project's logging and error-handling pattern.

Frequently Asked Questions about inc-function

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

FAQPage Schema
How do I add a new Parallels KA API call to a PHP licensing integration?

To add a new Parallels KA API call, you generate a procedural parallels_<action>() wrapper function in src/parallels.inc.php that calls the target \Detain\Parallels\Parallels method within a strict try/catch block logging both success and failure paths.

What's the best way to handle XML_RPC2_CurlException errors in MyAdmin Parallels integrations?

Handling XML_RPC2_CurlException errors requires wrapping your KA API method call in a try/catch block that returns false on failure and logs the error using both request_log and myadmin_log configured for the 'licenses' module and 'parallels' service.

How do I implement logging for KA API wrapper functions in PHP?

Implement logging for KA API wrapper functions by calling myadmin_log and request_log in both the success and failure paths of the try/catch block, ensuring all API activity is recorded for the 'licenses' module and 'parallels' service.

Does the Parallels API wrapper require typed signatures or PHP namespaces?

No, the Parallels API wrapper explicitly avoids namespaces, typed signatures, and return type hints, relying instead on simple procedural function additions to src/parallels.inc.php to match the project's standard legacy code pattern.

When should I not use a procedural wrapper for Parallels KA API methods?

You should not use this procedural wrapper approach for Plugin.php static event handlers or bin/ scripts, as it is specifically targeted for simple procedural API additions to src/parallels.inc.php.

Do I need new dependencies to wrap Parallels KA API calls with logging?

No, you do not need new dependencies to wrap Parallels KA API calls, as the function generation requires no packages beyond the project standard to execute the logging and error-handling pattern.