Esempio n. 1
0
 /**
  * Sets a script running on the backend.
  *
  * @param array $script  The filter script information. Passed elements:
  *                       - 'name': (string) the script name.
  *                       - 'recipes': (array) the filter recipe objects.
  *                       - 'script': (string) the filter script.
  *
  * @throws Ingo_Exception
  */
 public function setScriptActive($script)
 {
     $this->_connect();
     if (!strlen($script['script'])) {
         Ingo_Exception_Pear::catchError($this->_sieve->setActive(''));
         Ingo_Exception_Pear::catchError($this->_sieve->removeScript($script['name']));
         return;
     }
     Ingo_Exception_Pear::catchError($this->_sieve->haveSpace($script['name'], strlen($script['script'])));
     Ingo_Exception_Pear::catchError($this->_sieve->installScript($script['name'], $script['script'], true));
 }