summaryrefslogtreecommitdiff
path: root/lib/router.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-12-06 17:22:34 -0500
committerEvan Prodromou <evan@status.net>2010-12-06 17:22:34 -0500
commit25f644f4b99bc9fed024821c94885100c105d6a2 (patch)
tree0a5d938af38c36e6ea617e95e55b956eac527674 /lib/router.php
parent8564fc51c53de7a0670720eec437000a6b972688 (diff)
parent76946ea5a3636479d713f64471e86643936bc540 (diff)
Merge branch '0.9.x' into cacheactivity
Diffstat (limited to 'lib/router.php')
-rw-r--r--lib/router.php36
1 files changed, 13 insertions, 23 deletions
diff --git a/lib/router.php b/lib/router.php
index 8670519ff..eff88bb46 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -127,15 +127,19 @@ class Router
function __construct()
{
if (empty($this->m)) {
- $k = self::cacheKey();
- $c = Cache::instance();
- $m = $c->get($k);
- if (!empty($m)) {
- $this->m = $m;
- } else {
+ if (!common_config('router', 'cache')) {
$this->m = $this->initialize();
- $c->set($k, $this->m);
- }
+ } else {
+ $k = self::cacheKey();
+ $c = Cache::instance();
+ $m = $c->get($k);
+ if (!empty($m)) {
+ $this->m = $m;
+ } else {
+ $this->m = $this->initialize();
+ $c->set($k, $this->m);
+ }
+ }
}
}
@@ -156,21 +160,7 @@ class Router
static function cacheKey()
{
- $plugins = StatusNet::getActivePlugins();
- $names = array();
-
- foreach ($plugins as $plugin) {
- $names[] = $plugin[0];
- }
-
- $names = array_unique($names);
- asort($names);
-
- // Unique enough.
-
- $uniq = crc32(implode(',', $names));
-
- return Cache::key('router:'.STATUSNET_VERSION.':'.$uniq);
+ return Cache::codeKey('router');
}
function initialize()