-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearndb.php
44 lines (40 loc) · 1.12 KB
/
learndb.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
<?php
require_once('libs/Database.php');
require_once('libs/DiscoverDb.php');
$db = new Database;
$rc = new DiscoverDb($db);
$debug = $rc->getConfig()["debug"];
if ($argc > 1) {
for ($i = 1; $i < $argc; $i++) {
switch ($argv[$i]) {
case "before":
$rc->beforeSnapshot();
break;
case "complete":
$rc->afterSnapshot();
$rc->compare();
break;
case "after":
$rc->afterSnapshot();
break;
case "compare":
$rc->compare();
break;
case str_contains($argv[$i], 'export'):
$rc->exportFile($argv[$i]);
break;
case "get-tables":
$rc->getTables();
break;
case "help" || "h":
helpMenu();
break;
}
}
} else {
echo "No arguments passed.\n";
}
if ($debug) {
echo "Memory consumed: " . convert(memory_get_usage()) . "\n";
echo "Peak usage: " . convert(memory_get_peak_usage()) . " of memory.\n";
}