$staleAge) { rmdir($lockDir); } } $locked = @mkdir($lockDir); if ($locked === false) { $timeStart = microtime_float(); do { if ((microtime_float() - $timeStart) > $timeLimit) break; $locked = @mkdir($lockDir); } while ($locked === false); } $success = false; if ($locked === true) { $fp = @fopen($filename, 'w+'); if (@fwrite($fp, $data)) $success = true; @fclose($fp); rmdir($lockDir); } ignore_user_abort(0); return $success; } function &_write_table(&$thiz, $table, $id, $tmp, $setrs = true, $flush = true) { $rowset = "\n"; if ($setrs) { foreach ($thiz->columns as $key=>$value) { if ($key !== 'lastupd' && $key !== 'id') { if(!isset ($tmp[$key]) ) { if(isset($thiz->nncolumns[$key])){$rowset .= $thiz->nncolumns[$key];} $rowset .= "\n" ; } else $rowset .= $tmp[$key]."\n"; } } } else { $rowset = $tmp; } if (locked_filewrite($thiz->db_name.$table.'/'.$id.$thiz->ext,$rowset)) { return true; } else { $thiz->ErrorMsg[] = DB_ERRORMSG_105; return false; } } ?>