summaryrefslogtreecommitdiff
path: root/inc/subscription.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2010-05-08 12:35:51 +0200
committerAndreas Gohr <andi@splitbrain.org>2010-05-08 12:35:51 +0200
commitbe66694cc5d4ff7cad1467f20ab1e55611c97ff6 (patch)
treee8e8f926367a67fcd0c195d318cbd3efb84a45e5 /inc/subscription.php
parentdd512d246ef7a200ca1137bb267aee87380a2f6c (diff)
parent5f5509e5d91f69877aa6bd3b1cba15267e539fe2 (diff)
downloadrpg-be66694cc5d4ff7cad1467f20ab1e55611c97ff6.tar.gz
rpg-be66694cc5d4ff7cad1467f20ab1e55611c97ff6.tar.bz2
Merge branch 'master' of github.com:splitbrain/dokuwiki
Diffstat (limited to 'inc/subscription.php')
-rw-r--r--inc/subscription.php28
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.