Page tree
Skip to end of metadata
Go to start of metadata

 

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.

Warning:

cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.

Examples


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

Note:

For more information, read our Guide to the LiveAPI System.

 

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

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="cPAddon::mainpg ( $FORM('install'))">
 Command Line
cpapi1 --user=username cPAddons mainpg 

Note:

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

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

Parameters

Note:

$body

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.

Note:

$body

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.