Set a reasonable default for object cache, also use -1 for never expire to keep consistent with current cachelifetime config option
Set a reasonable default for object cache, also use -1 for never expire to keep consistent with current cachelifetime config option

--- a/include/cache/Cache.class.php
+++ b/include/cache/Cache.class.php
@@ -241,11 +241,7 @@
 
 		$this->tpl->caching = 2;
 
-		if (GitPHP_Config::GetInstance()->HasKey('objectcachelifetime')) {
-			$this->tpl->cache_lifetime = GitPHP_Config::GetInstance()->GetValue('objectcachelifetime');
-			if ($this->tpl->cache_lifetime == 0)
-				$this->tpl->cache_lifetime = -1;
-		}
+		$this->tpl->cache_lifetime = GitPHP_Config::GetInstance()->GetValue('objectcachelifetime', 86400);
 
 		$servers = GitPHP_Config::GetInstance()->GetValue('memcache', null);
 		if (isset($servers) && is_array($servers) && (count($servers) > 0)) {

comments