summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-15 16:09:40 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-15 16:09:40 -0700
commitfd290fc3f9a40a0d3be4e4ffc7d11846bf5295b8 (patch)
treef8195551fabc58d95272f980bd0f6cf423870763 /lib
parent177e4adf40bd41fc711c91fc6d16729b7f1b5796 (diff)
allow a configured base for cache keys
Diffstat (limited to 'lib')
-rw-r--r--lib/common.php1
-rw-r--r--lib/util.php8
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/common.php b/lib/common.php
index ab61c812f..51204cede 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -152,6 +152,7 @@ $config =
'memcached' =>
array('enabled' => false,
'server' => 'localhost',
+ 'base' => null,
'port' => 11211),
'ping' =>
array('notify' => array()),
diff --git a/lib/util.php b/lib/util.php
index 49c6ae108..1d5708bd6 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1322,7 +1322,13 @@ function common_session_token()
function common_cache_key($extra)
{
- return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra;
+ $base_key = common_config('memcached', 'base');
+
+ if (empty($base_key)) {
+ $base_key = common_keyize(common_config('site', 'name'));
+ }
+
+ return 'laconica:' . $base_key . ':' . $extra;
}
function common_keyize($str)