From: Colin M. <mi...@us...> - 2005-09-08 20:43:22
|
Update of /cvsroot/battletorrent/bmachine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6095 Modified Files: datastore.php Log Message: turned off caching code Index: datastore.php =================================================================== RCS file: /cvsroot/battletorrent/bmachine/datastore.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** datastore.php 8 Sep 2005 16:58:25 -0000 1.48 --- datastore.php 8 Sep 2005 20:43:14 -0000 1.49 *************** *** 28,32 **** var $error; ! var $cache; /** --- 28,32 ---- var $error; ! // var $cache; /** *************** *** 66,71 **** global $data_dir; ! global $cache; ! // if we don't do this, we will get the cached filetime, which could be wrong clearstatcache(); --- 66,71 ---- global $data_dir; ! // global $cache; ! /* // if we don't do this, we will get the cached filetime, which could be wrong clearstatcache(); *************** *** 73,77 **** if ( $hold_lock == false && isset($cache[$file]) && $cache[$file]["mtime"] == filemtime("$data_dir/$file") ) { return $cache[$file]["data"]; ! } $handle = fopen("$data_dir/$file", "a+b"); --- 73,77 ---- if ( $hold_lock == false && isset($cache[$file]) && $cache[$file]["mtime"] == filemtime("$data_dir/$file") ) { return $cache[$file]["data"]; ! }*/ $handle = fopen("$data_dir/$file", "a+b"); *************** *** 92,98 **** } ! $cache[$file]["mtime"] = filemtime("$data_dir/$file"); ! $cache[$file]["data"] = bdecode( $contents ); ! return $cache[$file]["data"]; } --- 92,100 ---- } ! // $cache[$file]["mtime"] = filemtime("$data_dir/$file"); ! // $cache[$file]["data"] = bdecode( $contents ); ! // return $cache[$file]["data"]; ! ! return bdecode( $contents ); } *************** *** 131,137 **** fwrite($handle,bencode($data)); ! global $cache; $cache[$file]["mtime"] = time("$data_dir/$file"); $cache[$file]["data"] = $data; fclose($handle); --- 133,140 ---- fwrite($handle,bencode($data)); ! /* global $cache; $cache[$file]["mtime"] = time("$data_dir/$file"); $cache[$file]["data"] = $data; + */ fclose($handle); |