Description
This function checks whether an account has a feature installed.
Examples
cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Features/has_feature?name=fantastico
LiveAPI PHP Class
$cpanel
=
new
CPANEL();
$Features_has_feature
=
$cpanel
->uapi(
'Features'
,
'has_features'
,
array
(
'name'
=>
'fantastico'
,
)
);
LiveAPI Perl Module
my
$cpliveapi
= Cpanel::LiveAPI->new();
my
$Features_has_feature
=
$cpliveapi
->uapi(
'Features'
,
'has_feature'
, {
'name'
=>
'fantastico'
,
}
);
cPanel Template Toolkit
[% data = execute( 'Features', 'has_feature', { name => 'fantastico'} ); %]
[% FOREACH q = data %]
<
p
>
[% q %]
</
p
>
[% END %]
Command Line
uapi --user=username Features has_feature name=fantastico
|
Output (JSON)
If the feature does not exist:
1
2
3
4
5
6
7
8
9
10
11
|
{
"messages": [
null
],
"errors": null,
"status": 0,
"metadata": {
},
"data": null
}
|
If the feature exists and is enabled:
1
2
3
4
5
6
7
8
9
10
11
|
{
"messages": [
null
],
"errors": null,
"status": 1,
"metadata": {
},
"data": null
}
|
If the feature exists and is not enabled:
1
2
3
4
5
6
7
8
9
10
11
|
{
"messages": [
"The feature "fantastico" exists but is not enabled."
],
"errors": null,
"status": 0,
"metadata": {
},
"data": null
}
|
Parameters
Parameter
|
Type
|
Description
|
Possible values
|
Example
|
name
|
string
|
The feature's name.
|
A valid string.
|
fantastico
|
Returns
Return
|
Type
|
Description
|
Possible values
|
Example
|
messages
|
string
|
Whether the feature exists and is installed.
|
- A localized confirmation message.
- A null value.
|
The feature "fantastico" exists but is not enabled.
|