migrationTest.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
define("AMDA_IHM", "../../");
define("DATAPATH", AMDA_IHM."generic_data/");
define("USERPATH", "/home/budnik/data/");
require_once AMDA_IHM."php/classes/UserWsTransfer.php";
$user = 'genot';
if (!is_dir(USERPATH)) mkdir(USERPATH);
if (!is_dir(USERPATH.$user)) mkdir(USERPATH.$user);
if (!is_dir(USERPATH.$user."/WS")) mkdir(USERPATH.$user."/WS");
if (!is_dir(USERPATH.$user."/TT")) mkdir(USERPATH.$user."/TT");
if (!is_dir(USERPATH.$user."/DATA")) mkdir(USERPATH.$user."/DATA");
if (!is_dir(USERPATH.$user."/REQ")) mkdir(USERPATH.$user."/REQ");
$convert = new UserWsTransfer($user);
$res = $convert->checkWS();
if (!$res['success']) exit($res['error']);
$res = $convert->transferMyData();
$msg = $res['msg'];
$res = $convert->transferDerived();
$msg .= $res['msg'];
$res = $convert->transferTimeTables();
$msg .= $res['msg'];
$res = $convert->transferConditions();
$msg .= $res['msg'];
// $res = $convert->transferRequests();
// $msg .= $res['msg'];
$res = $convert->transferFilters();
$msg .= $res['msg'];
echo $msg.PHP_EOL;
?>