Skip to content

Commit f50018f

Browse files
authored
Merge pull request #9 from josaphatim/added-noop-and-checkScript-methods
Added support for checkScript and noop methods
2 parents 14d902e + c21ebac commit f50018f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/ManageSieve/Client.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,4 +671,39 @@ public function hasSpace($name, $size)
671671
}
672672
return false;
673673
}
674+
675+
/**
676+
* Verifies script validity without storing the script on the server
677+
*
678+
* @param string $name The name of the script.
679+
* @param string $size The size of the script.
680+
*
681+
* @return boolean
682+
*/
683+
public function checkScript($content)
684+
{
685+
$content = $this->prepareContent($content);
686+
$return_payload = $this->sendCommand("CHECKSCRIPT", [$content]);
687+
if ($return_payload["code"] == "OK") {
688+
return true;
689+
}
690+
return false;
691+
}
692+
693+
/**
694+
* Used for re-synchronization or to reset any inactivity auto-logout timer on the server.
695+
*
696+
* @param string $name The name of the script.
697+
* @param string $size The size of the script.
698+
*
699+
* @return boolean
700+
*/
701+
public function noop()
702+
{
703+
$return_payload = $this->sendCommand("NOOP");
704+
if ($return_payload["code"] == "OK") {
705+
return true;
706+
}
707+
return false;
708+
}
674709
}

0 commit comments

Comments
 (0)