parent
50ab250f13
commit
43e4ef1453
|
|
@ -304,12 +304,17 @@
|
|||
$backup_path = _HYPROXY . 'baks' . DS . $bak_name;
|
||||
if (file_exists($backup_path)) {
|
||||
$backup = file_get_contents($backup_path);
|
||||
$list = json_decode($backup, true);
|
||||
//修复mysql保留字段index问题导致无法写入
|
||||
foreach ($list as &$row) {
|
||||
$row['`index`'] = $row['index'];
|
||||
unset($row['index']);
|
||||
}
|
||||
global $medoo;
|
||||
$table = 'module_hyproxy';
|
||||
$medoo->delete($table, null);
|
||||
$medoo->query("alter table $table auto_increment=1");
|
||||
$medoo->insert($table, json_decode($backup, true));
|
||||
print_r($backup);
|
||||
$medoo->insert($table, $list);
|
||||
hyproxy_make();
|
||||
return "[OK] Proxy restore success\n";
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue