-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathdbrepair.php
45 lines (37 loc) · 1.13 KB
/
dbrepair.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
<?php
/**
* This file is a part of MyWebSQL package
*
* @file: modules/dbrepair.php
* @author Samnan ur Rehman
* @copyright (c) 2008-2014 Samnan ur Rehman
* @web http://mywebsql.net
* @license http://mywebsql.net/license
*/
function processRequest(&$db) {
if (isset($_POST['optype']) && is_array(v($_POST['tables'])) ) {
checkTables($db);
}
else {
$replace = array();
echo view('dbrepair', $replace, $db->getTables());
}
}
function checkTables(&$db) {
$type = v($_POST['optype']);
$options = array('skiplog' => v($_POST['skiplog']) == 'on' ? TRUE : FALSE);
$options['checktype'] = v($_POST['checktype']);
$options['repairtype'] = is_array(v($_POST['repairtype'])) ? v($_POST['repairtype']) : array();
include(BASE_PATH . "/lib/tablechecker.php");
$checker = new tableChecker($db);
$checker->setOperation($type);
$checker->setTables(v($_POST['tables']));
$checker->setOptions($options);
$results = array();
if ($checker->runCheck())
$results = $checker->getResults();
$replace = array('RESULTS' => json_encode($results)
);
echo view('dbrepair_results', $replace);
}
?>