diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-08-23 14:51:33 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-08-23 14:51:33 +0000 |
commit | 68f3b69055f2195e6a0a8e614b9f67628503b9ed (patch) | |
tree | 2f33e1fae0f16b915febbd239a2aece3cbd59d5a /lib/class/database_object.abstract.php | |
parent | 1b35ffb126323271507b6e170314c5138c9c8c4c (diff) | |
download | ampache-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.php | 13 |
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 |