function main() { $f = fopen("temp.xml", "w"); $teams = BoincTeam::enum(); fwrite($f, "<teams>\n"); foreach ($teams as $team) { handle_team($team, $f); } fwrite($f, "</teams>\n"); fclose($f); rename("temp.xml", "/home/boincadm/boinc/doc/boinc_teams.xml"); }
function main() { echo "------------ Starting at " . time_str(time()) . "-------\n"; $f = fopen("temp.xml", "w"); $teams = BoincTeam::enum(null); fwrite($f, "<teams>\n"); foreach ($teams as $team) { handle_team($team, $f); } fwrite($f, "</teams>\n"); fclose($f); if (!rename("temp.xml", "/home/boincadm/boinc/doc/boinc_teams.xml")) { echo "Rename failed\n"; } }
function main() { $f = fopen("http://boinc.berkeley.edu/boinc_teams.xml", "r"); if (!$f) { echo "Can't get times file\n"; exit; } while ($s = fgets($f)) { if (strstr($s, '<team>')) { handle_team($f); } } }
function main() { echo "------------ Starting at " . time_str(time()) . "-------\n"; $f = fopen("http://boinc.berkeley.edu/boinc_teams.xml", "r"); if (!$f) { echo "Can't get times file\n"; exit; } while ($s = fgets($f)) { if (strstr($s, '<team>')) { handle_team($f); } } echo "------------ Finished at " . time_str(time()) . "-------\n"; }