migrationTest.php 1.1 KB
<?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;     
?>