protected _cmdListScripts ( ) : array | ||
Résultat | array | An array with the list of scripts in the first element and the active script in the second element. |
protected function _cmdListScripts()
{
$this->_checkAuthenticated();
$result = $this->_doCmd('LISTSCRIPTS');
$scripts = array();
$activescript = null;
$result = explode("\r\n", $result);
foreach ($result as $value) {
if (preg_match('/^"(.*)"( ACTIVE)?$/i', $value, $matches)) {
$script_name = stripslashes($matches[1]);
$scripts[] = $script_name;
if (!empty($matches[2])) {
$activescript = $script_name;
}
}
}
return array($scripts, $activescript);
}