Child pages
  • cPanel API 2 Functions - LangMods::search

Versions Compared

Key

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

 

Description

Excerpt

This function lists a cPanel-supported scripting language's available modules.

Include Page
LIB:_cPanelAPI2NoEquivalent
LIB:_cPanelAPI2NoEquivalent


Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleWHM API (JSON)


Code Block
languagetext
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=LangMods&cpanel_jsonapi_func=search&lang=php-pear&skip=3&want=6&regex=Lite

Include Page
LIB:_CallFromWHMAPILink
LIB:_CallFromWHMAPILink


Expand
titleLiveAPI PHP Class


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Search for Lite in language modules
my $get_phppear_modules = $cpliveapi->api2(
    'LangMods', 'search',
		array(
		'lang'			=> 'php-pear',
		'skip'			=> '3',
		'want'			=> '6',
		'regex'			=> 'Lite',
	  )
  );

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Search for Lite in language modules.
$search_lang_modules = $cpanel->api2(
    'LangMods', 'search',
	{
		'lang'		=> 'perl',
		'skip'		=> '3',
		'want'		=> '6',
	 	'regex'		=> 'Lite',
	} 
 );

 

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelAPI2cPanelTagsWarning
LIB:_cPanelAPI2cPanelTagsWarning


Expand
titleCommand Line


Code Block
languagetext
cpapi2 --user=username LangMods search lang=perl skip=3 want=6 regex=Lite

Include Page
LIB:_cPanelAPI2CLINote
LIB:_cPanelAPI2CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "cpanelresult":{  
      "apiversion":2,
      "func":"search",
      "data":[  
         {  
            "info":"Fast and Safe little cache system",
            "docurl":"http://pear.php.net/package/Cache_Lite/docs",
            "latest":"1.7.16",
            "installed":"stable",
            "module":"Cache_Lite",
            "stable":"stable"
         },
         {  
            "info":"a lightweight and fast Config class for ini style text configuration files.",
            "docurl":"http://pear.php.net/package/Config_Lite/docs",
            "latest":"1.7.15",
            "installed":"0.2.1",
            "module":"Config_Lite",
            "stable":"0.2.1"
         },
         {  
            "info":"DB_Sqlite_Tools is an object oriented interface to effectively manage and backup Sqlite databases.",
            "docurl":"http://pear.php.net/package/DB_Sqlite_Tools/docs",
            "latest":"beta",
            "installed":"0.1.7",
            "module":"DB_Sqlite_Tools",
            "stable":"0.1.7"
         },
         {  
            "info":"sqlite MDB2 driver",
            "docurl":"http://pear.php.net/package/MDB2_Driver_sqlite/docs",
            "latest":"alpha",
            "installed":"1.5.0b4",
            "module":"MDB2_Driver_sqlite",
            "stable":"1.5.0b4"
         }
      ],
      "event":{  
         "result":1
      },
      "module":"LangMods"
   }
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
langstring

Required

The scripting language's short name.

A available scripting language on your server.

Note
-titled
titleNote:

The LangMods::langlist function returns possible values.


perl
skipinteger

The number of responses to skip at the beginning of the function's output.

Use this parameter with the want parameter to paginate the function's output.

This value defaults to 0.

A positive integer.3
wantinteger

The number of responses to return in the function's output.

This value defaults to 100.

A positive integer.6
regexstring

Required

A Perl Compatible Regular Expression (PCRE) that filters the results.

A valid PCRE.Lite

 

Returns

ReturnTypeDescriptionPossible valuesExample
infostringAny relevant information about the module.A string value.
sqlite MDB2 driver
docurlstringThe system's homepage.A URL.
http://pear.php.net/package/MDB2_Driver_sqlite/docs
lateststringThe module's latest version.A module version number.alpha
installedstringThe module's installed version.
  • A module version number.
  • null — The module is not installed.
1.5.0b4
modulestringThe module's name.A module name.
MDB2_Driver_sqlite
stablestringThe module's stable version.A module version number.1.5.0b4
reasonstring

A reason for failure.

Note
titleNote:

This function only returns a reason value if there was an error.


A string that describes the error. This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1