3 Sends out a binary backup in the format accepted by the ../t_transfer
4 utility. You only must configure a recipient.
7 // define("BINBACKUP_TO", "you@example.com"); // who gets the backup
8 define("BINBACKUP_TEXTONLY", 1); // include ?binary entries or not
12 if (defined("BINBACKUP_TO")) {
15 define("EWIKI_TRANSFER_IDF", "EWBF00000025"); // file magic
19 $mail .= EWIKI_TRANSFER_IDF;
21 $result = ewiki_db::GETALL(array("id","version","flags"));
22 while ($row = $result->get()) {
25 for ($v=$row["version"]; $v>0; $v--) {
27 $row = ewiki_db::GET($id, $v);
29 if (BINBACKUP_TEXTONLY && !(EWIKI_DB_F_TEXT & $row["flags"]))
34 if ($row && ($row = serialize($row))) {
35 $mail .= "\n" . strlen($row) . "\n" . $row;
42 $mail = gzencode($mail);
43 $mail = base64_encode($mail);
46 "[backup] " . EWIKI_NAME . ":",
48 "Content-Transfer-Encoding: base64\n"
49 ."Content-Encoding: deflate\n"
50 ."Content-Type: application/x.vnd.ewiki.transfer-file\n"
51 ."X-Mailer: ewiki/".EWIKI_VERSION."\n"
52 ."From: ewiki@$_SERVER[SERVER_NAME]\n"
53 ."Reply-To: trashbin@example.com\n"