-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestdb.php
167 lines (131 loc) · 3.57 KB
/
testdb.php
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
include ('utils.php');
define('flag', TRUE);
include (__DIR__ . '/../contents/dtypes.php');
include('db.php');
include('fs.php');
$db = new Database(key9, key10, key11, key12);
$db->connect();
$res = $db->getJobNames(1);
//print_r($res);
echo json_encode($res) . '<br>';
$job = $res[0]['jobName'];
/*echo "For Project: " . $job . "<br>";
$res = $db->getProjectDir($job);
echo "Path: ";
print_r($res);
echo '<br>';
*/
/*
$res = $db->getMutInfo($job);
echo "Mutation JSON Info: ";
print_r($res);
echo '<br>';
*/
$res = $db->getJobInfo($job);
echo "JobInfo JSON: ";
//print_r($res);
echo json_encode($res) . '<br>';
$res = $db->getEvalList("[email protected]");
echo "Evaluation List json: ";
//print_r($res);
echo json_encode($res) . '<br>';
$res = $db->getPurp();
echo "Purposes json: ";
//print_r($res);
echo json_encode($res) . '<br>';
$res = $db->userInfo("[email protected]");
echo "UserInfo JSON: ";
//print_r($res);
echo json_encode($res) . '<br>';
/*$res = $db->evaluation("[email protected]", "a-special-jobname", "a-special-mutation", 2, "This is a special message from me for this mutation.");
echo "Eval: ";
//print_r($res);
echo $res . '<br>';
$res = $db->getEval("[email protected]", "a-special-jobname", "a-special-mutation");
echo "getEval: ";
//print_r($res);
echo json_encode($res) . '<br>';
*/
/* TEST getProject ****
const LOCAL_FPATH = __DIR__ . "\\temp\\";
//$db = new Database(key9, key10, key11, key12);
//$db->connect();
//$remotePath = $db->getProjectDir($job);
$remotePath = '/pica/h1/fredrw/private/project/';
echo $remotePath . "<br>";
//$db->disconnect();
if(!$remotePath){
return false;
}
$remotePath .= 'A-37-M' . '/last.2.pdb';
echo $remotePath . '<br>';
$localFile = LOCAL_FPATH . 'session_unq_id_001';
echo $localFile . "<br>";
if(!file_exists($localFile) || !is_dir($localFile)){
echo "Folder not exists. Create:<br>";
if(!mkdir($localFile)){
return false;
}
echo "Folder \"" . $localFile . "\" Successfully created. <br>";
}
clearstatcache();
$localFile .= '\\last.2.pdb';
echo $localFile . "<br>";
if(file_exists($localFile) && !is_dir($localFile)){
echo "File exists. Delete:<br>";
if(!Utils::deleteTempPdbFile('session_unq_id_001' . '\\last.2.pdb')){
return false;
}
echo "File \"" . $localFile . "\" Successfully Deleted.<br>";
}
clearstatcache();
$fs = new FileServer(key5, key8, key6);
$fs->ssh_connection();
$aResult['result'] = $fs->scp_bring($remotePath, $localFile);
$fs->disconnect();
echo $aResult['result'] . "<br>";
/*
$res = $db->getMutString($job);
echo "Mutation String: ";
print_r($res);
echo '<br>';
$res = $db->getWTString($job);
echo "WildType String: ";
print_r($res);
echo '<br>';
$res = $db->getProjectDir($job);
echo "Project Directory: ";
print_r($res);
echo '<br>';
$res = $db->getStatus($job);
echo "Status: ";
print_r($res);
echo '<br>';
$res = $db->getDDG($job, $db->getMutString($job)[0]);
echo "DDG: ";
print_r($res);
echo '<br>';
*/
//Utils::deleteTempPDBFile();
/*
$res = $db->userLogin("[email protected]", '123');
echo "Login: ";
print_r($res);
echo '<br>';
*/
/*
$res = $db->userReg('[email protected]', '123', null, null, 1);
echo "Reg: ";
print_r($res);
echo '<br>';
*/
//$db->tableExists('reg_user');
/*$db->select("reg_user", "fname, passwd");
//$db->insert("reg_user", array("[email protected]", "poko", "paki", "dumdum", 2), "`email`, `fname`, `lname`, `passwd`, `use`");
//$db->update("reg_user", array('passwd'=>'gumgum'), array("fname='poko'"));
$res = $db->getResult();
print_r($res);
*/
$db->disconnect();
?>