-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathem-optimize-master_do.php
More file actions
39 lines (39 loc) · 955 Bytes
/
em-optimize-master_do.php
File metadata and controls
39 lines (39 loc) · 955 Bytes
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
<?php
require_once('../../../init.php');
if($_GET['opt']){
/*Load the language*/
require_once(EMLOG_ROOT . "/content/plugins/em-optimize-master/lang/".Option::get('language').".php");
/*end*/
LoginAuth::checkToken();
$DB = Database::getInstance();
$alltables = $DB->query("SHOW TABLES");
echo "<thead>
<tr>
<th><b>".$_lang['name']."</b></th>
<th class=\"tdcenter\"><b>".$_lang['state']."</b></th>
</tr>
</thead>
<tbody>";
ob_start();
while ($table = mysqli_fetch_assoc($alltables))
{
echo "<tr>";
foreach ($table as $key => $tablename)
{
ob_flush();
echo "<td>".$tablename."</td>";
$qry = ("OPTIMIZE TABLE $tablename");
$rez = $DB->query($qry);
if ($rez) { echo "<td class=\"tdcenter\"> ".$_lang['succ']." </td>";
} else {
echo " <td class=\"tdcenter\">".$_lang['fail']." !</td>";
}
ob_flush();
flush();
usleep(500000);
}
echo "</tr>";
}
echo " </tbody>";
}
?>