summaryrefslogtreecommitdiffstats
path: root/lib/class/database_object.abstract.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-08-23 14:51:33 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-08-23 14:51:33 +0000
commit68f3b69055f2195e6a0a8e614b9f67628503b9ed (patch)
tree2f33e1fae0f16b915febbd239a2aece3cbd59d5a /lib/class/database_object.abstract.php
parent1b35ffb126323271507b6e170314c5138c9c8c4c (diff)
downloadampache-68f3b69055f2195e6a0a8e614b9f67628503b9ed.tar.gz
ampache-68f3b69055f2195e6a0a8e614b9f67628503b9ed.tar.bz2
ampache-68f3b69055f2195e6a0a8e614b9f67628503b9ed.zip
sync from branch
Diffstat (limited to 'lib/class/database_object.abstract.php')
-rw-r--r--lib/class/database_object.abstract.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/class/database_object.abstract.php b/lib/class/database_object.abstract.php
index 0f7b379f..50e45f23 100644
--- a/lib/class/database_object.abstract.php
+++ b/lib/class/database_object.abstract.php
@@ -30,6 +30,7 @@ abstract class database_object {
// Statistics for debugging
public static $cache_hit = 0;
+ private static $_enabled = false;
/**
* get_info
@@ -97,6 +98,8 @@ abstract class database_object {
*/
public static function add_to_cache($index,$id,$data) {
+ if (!self::$_enabled) { return false; }
+
$value = is_null($data) ? false : $data;
self::$object_cache[$index][$id] = $value;
@@ -115,4 +118,14 @@ abstract class database_object {
} // remove_from_cache
+ /**
+ * _auto_init
+ * Load in the cache settings once so we can avoid function calls
+ */
+ public static function _auto_init() {
+
+ self::$_enabled = Config::get('memory_cache');
+
+ } // _auto_init
+
} // end database_object