Config flag to disable router caching if needed

This commit is contained in:
Evan Prodromou
2010-12-06 17:19:41 -05:00
parent 8c4e14b59c
commit bb63fd4b75
3 changed files with 26 additions and 8 deletions

View File

@@ -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);
}
}
}
}