summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index ff22ac644..349cff722 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1528,3 +1528,13 @@ function common_session_token() {
}
return $_SESSION['token'];
}
+
+function common_cache_key($extra) {
+ return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra;
+}
+
+function common_keyize($str) {
+ $str = strtolower($str);
+ $str = preg_replace('/\s/', '_', $str);
+ return $str;
+}