Introduction to Standardized Hooks
For cPanel & WHM 11.32
This introduction provides rudimentary information about the Standardized Hooks System. If you're interested in the system's taxonomy, you should review the Standardized Hooks Taxonomy
The Standardized Hooks System is useful for developers and administrators who want to automatically trigger a script or application when a specific action is performed in cPanel & WHM. This system allows you to customize how cPanel & WHM functions in generic or specific scenarios. Having this fine-grain control allows more flexibility when implementing cPanel & WHM systems and the end-user functionality therein.
Previous versions of cPanel & WHM offer several, independent systems of hooking particular functionality. The Standardized Hooks System unifies all previous systems into a single, standard system.
Important features of the Standardized Hooks System
- You can run multiple hooks when a single action occurs.
- Hook operation can be written as a Perl module or as a language-agnostic script.
- The Standardized Hooks System includes a CLI management system.
- Hook execution, priority, failure actions, and debugging are governed by a lightweight Perl Module.
- You can hook into major accounting features, API 1, API 2, and some system functionality. (See hookable events).
- Many Insertion Points are "pre-event" based and can force the original event to fail prior to cPanel & WHM action.
- The system includes a hooks registry for each hookable event. This allows hooks from your application to co-exist with hooks from another application that reference the same event.
What is a Standardized Hook?
A Standardized Hook is comprised of custom code, authored by a developer or system administrator, that is executed at a particular point in cPanel & WHM code. The custom code is referred to as hook action code
. The various points in the cPanel & WHM code that trigger the execution of custom code are call hookable events
Which events can I hook?
cPanel & WHM events that trigger a Standardized Hook are called hookable events
. There are many hookable events in cPanel & WHM, as well as in its supporting scripts. All hookable events are itemized in the Canonical Reference of cPanel & WHM Hookable Events
How do I manage my Standardized Hooks?
cPanel & WHM provides a CLI utility for managing standardized hooks. This utility associates hook action code
with a hookable event
. Developers, technicians, and system administrators can reference the Standardized Hooks Management
document for details on adding, listing, and removing Standardized Hooks.
Topic revision: r6 - 21 Mar 2012 - 13:51:42 - Main.JustinSchaefer
SoftwareDevelopmentKit.StdHooksIntro moved from Sandbox.StdHooksIntro on 12 Mar 2012 - 20:45 by Main.JustinSchaefer
- put it back