Description


This function provides tools to install a cPAddon.

 This function performs the following actions:

  1. Retrieves a list of installable cPAddons.
  2. Displays the cPAddon creation interface.
  3. Installs a cPAddon.
  4. Changes the account's cPAddon notification status.

Examples




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$show_disk_usage = $cpanel->api1('cPAddons', 'mainpg', array('install') ); // Call the function.

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $retrieve_port = $cpliveapi->api1('cPAddons', 'mainpg', ['install']); # Call the function.

 


<cpanel Module="cPAddon::mainpg ( $FORM('install'))">




cpapi1 --user=username cPAddons mainpg 


For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.  



This function's output varies dramatically based on the account's files and the input parameters that you pass.



Parameters


If you call this function without parameters, the system retrieves a list of available cPAddons.


ParameterTypeDescriptionPossible valuesExample
actionstringThe action to perform.

Each cPAddon has its own requirements. The addon parameter can generate the necessary { action => install } parameters.

$VAR1 = {
 'addon' => 'cPanel::CMS::Xoops',
 'action' => 'install',
 'auser' => 'adminuser',
 'apass' => 'adminpass',
 'apass2' => 'adminpass',
 'email' => 'test@example.com',
 'subdomain' => '',
 'installdir' => 'xoops',
 'admin_display' => 'admindisplayname',
 'use_persistent' => 0,
 'table_prefix' => 'xoops',
 'existing_mysql' => ''
 };


install
addonstring

Whether to display the cPAddon's configuration GUI.

If you use this parameter, the function displays the cPAddon's configuration GUI.


Any cPAddon name.cPanel::CMS::Geeklog
asuserstringThe cPAddon's administrator.The cPAddon administrator's username.adminuser
onBoolean

Whether to enable notifications.

Use this parameter if you set the action parameter to notify.

  • 0 — Disable notifications.
  • 1 — Enable notifications.
1

 

Returns

This function returns output that varies dramatically based on the input parameters that you pass.