Horde\ManageSieve::_cmdListScripts PHP Method

_cmdListScripts() protected method

Returns the list of scripts on the server.
protected _cmdListScripts ( ) : array
return 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);
    }