Horde\ManageSieve::listScripts PHP Méthode

listScripts() public méthode

Returns an indexed array of scripts currently on the server.
public listScripts ( ) : array
Résultat array Indexed array of scriptnames.
    public function listScripts()
    {
        if (is_array($scripts = $this->_cmdListScripts())) {
            return $scripts[0];
        } else {
            return $scripts;
        }
    }

Usage Example

Exemple #1
0
 public function testRemoveScript()
 {
     $this->clear();
     $this->login();
     $scriptname = 'test script1';
     $before_scripts = $this->fixture->listScripts();
     $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
     $this->fixture->removeScript($scriptname);
     $after_scripts = $this->fixture->listScripts();
     $diff_scripts = array_values(array_diff($after_scripts, $before_scripts));
     $this->assertTrue(count($diff_scripts) == 0, 'Script still installed');
     $this->logout();
 }