diff options
Diffstat (limited to 'inc/subscription.php')
-rw-r--r-- | inc/subscription.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/inc/subscription.php b/inc/subscription.php index e5938d9bd..ce5da4cd4 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -9,6 +9,8 @@ * - subscription_set * - get_info_subscribed * - subscription_addresslist + * - subscription_lock + * - subscription_unlock * * @author Adrian Lang <lang@cosmocode.de> * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) @@ -37,6 +39,32 @@ function subscription_filename($id) { } /** + * Lock subscription info for an ID + * + * @param string $id The target page or namespace, specified by id; Namespaces + * are identified by appending a colon. + * + * @author Adrian Lang <lang@cosmocode.de> + */ +function subscription_lock($id) { + $lockf = subscription_filename($id) . '.lock'; + return !file_exists($lockf) && touch($lockf); +} + +/** + * Unlock subscription info for an ID + * + * @param string $id The target page or namespace, specified by id; Namespaces + * are identified by appending a colon. + * + * @author Adrian Lang <lang@cosmocode.de> + */ +function subscription_unlock($id) { + $lockf = subscription_filename($id) . '.lock'; + return file_exists($lockf) && unlink($lockf); +} + +/** * Set subscription information * * Allows to set subscription informations for permanent storage in meta files. |