public function __construct($script, $ext = array(), $elsif = true)
{
$this->raw = $script;
$this->elsif = $elsif;
// adjust supported extenstion to match sieve server
$this->supported = array_intersect($this->supported, $ext);
if (in_array('copy', $ext)) {
$this->supported = array_merge($this->supported, array('fileinto_copy', 'redirect_copy'));
}
if (in_array('editheader', $ext)) {
$this->supported = array_merge($this->supported, array('editheaderadd', 'editheaderrem'));
}
// include standard actions in supported list
$this->supported = array_merge($this->supported, array('redirect', 'keep', 'discard', 'stop'));
// load script
$this->content = $this->parse_text($script);
}