method listCommands documentation in bbn\Api\Virtualmin
Gets all the commands directly from the API
function(array $param = [])
{
//Prepping, processing and validating the create user parameters
$param = $this->processParameters($param);
//Setting the last action performed
$this->lastAction = "list-commands";
//Defining the $url_part and the command to be executed
$url_part = "list-commands";
if (isset($param['short'])) {//short parameter is set
$url_part .= "&short";
}
if (isset($param['nameonly'])) {//nameonly parameter is set
$url_part .= "&nameonly";
}
//Concatenating the header url and $url_part to create the full url to be executed
$url_part = $this->getHeaderUrl() . $url_part . "'";
//test
$uid = $this->hostname;
if (!empty($param)) {
$uid .= md5(json_encode($param));
}
if ($this->cacheHas($uid, 'list_commands')) {
$result_call = $this->cacheGet($uid, 'list_commands');
}
else {
$result_call = $this->callShellExec($url_part);
$this->cacheSet($uid, 'list_commands', $result_call);
}
return $result_call;
}
Gets all the commands directly from the API BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions