Child pages
  • cPanel API 1 Functions - NVData::set

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Description

Excerpt

This function sets the value of a variable. 

The system stores the value in the /home/$user/.cpanel/nvdata directory.

Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)NVData::set
    Excerpt Include
    SDK:UAPI Functions - NVData::set
    SDK:UAPI Functions - NVData::set
    nopaneltrue
  • cPanel API 2NVData::set
    Excerpt Include
    SDK:cPanel API 2 Functions - NVData::set
    SDK:cPanel API 2 Functions - NVData::set
    nopaneltrue


Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$set_nv_location = $cpanel->api1('NVData', 'set', array('location', 'Houston', '0') ); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $set_nv_location = $cpliveapi->api1('NVData', 'set', ['location', 'Houston', '0'] ); # Call the function.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="NVData::set( $FORM('name', 'value', 'nocache') )">



Expand
titleCommand Line


Code Block
languagebash
cpapi1 --user=username NVData set location Houston 0

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (none)

This function does not return output.



Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

Required

A variable.

A valid variable name.
location
valuestring

Required

The variable's value.

Any valid string.Houston
nocacheBoolean

Required

Whether to cache the value. The cache improves system performance.

  • 1 — Do not save the value in the cache.
  • 0 — Save the value in the cache.
0

Returns

This function does not return output.