Introduction
The LiveAPI system uses the following methods to interact with cPanel & WHM. Use these methods with either the LiveAPI PHP Class or the LiveAPI Perl Module.
- For more information about methods in PHP classes, read php.net's Classes and Objects documentation.
- For more information about methods in Perl, read perl.org's perlobj documentation .
Methods
The LiveAPI system includes the following methods to interact with cPanel & WHM:
api()— Theapi()method executes a cPanel API 1 or cPanel API 2 function.-
api1()— Theapi1()function executes a cPanel API 1 function. For use information and examples, read our Guide to cPanel API 1. -
api2()— Theapi2()function executes a cPanel API 2 function. For use information and examples, read our Guide to cPanel API 2. cpanelfeature()— Thecpanelfeature()method is a wrapper for thefeaturetag, which checks whether the authenticated user has access to a feature.cpanelif()— Thecpanelif()method is a wrapper for thecpaneliftag, which evaluates a cPanel variable or logic operator.-
cpanellangprint()— Thecpanellangprint()method is a wrapper for the deprecated lang system'slangprinttag. This method is deprecated. cpanelprint()— Thecpanelprint()method returns a cPanel variable's value.debug_log()— Thedebug_log()method writes data to the debugging log file.debug_log_json()— Thedebug_log_json()method writes JSON data to the debugging log file.end()— Theend()method deconstructs theCpanel::LiveAPIobject and closes the connection to cPanel & WHM.exec()— Theexec()method executes a cPanel tag.fetch()— Thefetch()method is a wrapper to return a hash reference from thecpanelprint()function, which retrieves a cPanel variable.footer()— Thefooter()method calls the cPanel interface's footer.get_debug_level()— Theget_debug_level()method retrieves the current debug level.get_debug_log()— Theget_debug_log()method retrieves the debug log file's absolute path and filename.get_result()— Theget_result()method fetches the most recent data result node. This method is for the LiveAPI PHP Class only.header()— Theheader()method calls the cPanel interface's header.new()— Thenew()method instantiates theCpanel::LiveAPIobject.set_debug()— Theset_debug()method sets the amount of debug information to store in LiveAPI's debug log file.-
uapi()— Theuapi()function executes a UAPI function.
