417be01a62014f7917caa958db5596aaf5a94dc5
[atutor.git] / mods / wiki / tools / t_backup.php
1 <?php
2
3   include("t_config.php");
4   ob_start(); include($lib = dirname(__FILE__)."/ewikictl"); ob_end_clean();
5
6 ?>
7 <html>
8 <head>
9  <title>generate backup files from ewiki pages</title>
10  <link rel="stylesheet" type="text/css" href="t_config.css">
11 </head>
12 <body bgcolor="#ffffff" text="#000000">
13 <h1>database/page backup</h1>
14
15 <?php
16
17   if (empty($_REQUEST["backup"])) {
18
19      ?>
20
21     This tool is not intended to make a complete and safe backup of your ewiki
22     database, use PHPMySQLAdmin for such purposes; or save raw serialized(SQL
23     query results) with a dedicated script.
24     <br><br>
25
26     <form action="t_backup.php" method="get">
27
28      <b>directory</b> to save backup files:<br>
29      <input type="text" name="dest" value="/var/backup/ewiki/">
30      <br><small>(either absolute or relative to location of ewiki.php)</small><br>
31      <br>
32
33      backup <b>format</b>:<br>
34      <select name="format">
35        <option value="plain">plain text files</option>
36        <option value="flat" selected="selected">flat files (message/http)</option>
37        <option value="fast">fast files (serialized)</option>
38        <option value="meta">plain with companion .meta files</option>
39        <option value="xml">save whole page data as pseudo xml</option>
40        <option value="xmlmeta">companion .meta files in xml style</option>
41      </select>
42      <br><small>Note that only the first three variants can be reinserted later.<small><br>
43      <br>
44
45      <b>versions</b> store behaviour:<br>
46      <select name="behaviour">
47        <option value="all" selected="selected">save all versions of each page (.NNN extensions)</option>
48        <option value="last">backup only the very last (newest) page version</option>
49      </select><br>
50      <br>
51
52      other settings:<br>
53      <input type="checkbox" name="urlencode" value="1"> <b>urlencode</b>, write dbff-filenames assuming DOS filesystem restrictions (not required on UNIX systems) <br>
54      <input type="checkbox" name="force" value="1"> <b>enforce</b>, override problems (use this only if first try failed)<br>
55      <br>
56
57      <input type="submit" name="backup" value="backup">
58      <br><br>
59
60     </form>
61
62
63      <?php
64
65   }
66   else {
67
68      echo "<b>ewikictl</b>:<br>\n<br>\n\n<tt>\n";
69
70      $config["dest"] = $_REQUEST["dest"];
71      $config["format"] = $_REQUEST["format"];
72      $config["force"] = $_REQUEST["force"];
73      $config["urlencode"] = $_REQUEST["urlencode"];
74
75      if ($_REQUEST["behaviour"]=="all") {
76         $config["all"] = 1;
77      }
78
79      set_options_global();
80
81      command_backup();
82
83
84
85      echo "</tt>\n";
86
87   }
88
89
90 ?>
91 </body>
92 </html>