uawdijnntqw1x1x1
IP : 3.144.104.233
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,show_source,eval,open_base
OS : Linux
PATH:
/
home
/
sudancam
/
.trash
/
__MACOSX
/
..
/
admin
/
.
/
model
/
tool
/
backup.php
/
/
<?php class ModelToolBackup extends Model { public function getTables() { $table_data = array(); $query = $this->db->query("SHOW TABLES FROM `" . DB_DATABASE . "`"); foreach ($query->rows as $result) { $table = reset($result); if ($table && utf8_substr($table, 0, strlen(DB_PREFIX)) == DB_PREFIX) { $table_data[] = $table; } } return $table_data; } public function backup($tables) { $output = ''; foreach ($tables as $table) { if (DB_PREFIX) { if (strpos($table, DB_PREFIX) === false) { $status = false; } else { $status = true; } } else { $status = true; } if ($status) { $output .= 'TRUNCATE TABLE `' . $table . '`;' . "\n\n"; $query = $this->db->query("SELECT * FROM `" . $table . "`"); foreach ($query->rows as $result) { $fields = ''; foreach (array_keys($result) as $value) { $fields .= '`' . $value . '`, '; } $values = ''; foreach (array_values($result) as $value) { $value = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $value); $value = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $value); $value = str_replace('\\', '\\\\', $value); $value = str_replace('\'', '\\\'', $value); $value = str_replace('\\\n', '\n', $value); $value = str_replace('\\\r', '\r', $value); $value = str_replace('\\\t', '\t', $value); $values .= '\'' . $value . '\', '; } $output .= 'INSERT INTO `' . $table . '` (' . preg_replace('/, $/', '', $fields) . ') VALUES (' . preg_replace('/, $/', '', $values) . ');' . "\n"; } $output .= "\n\n"; } } return $output; } }
/home/sudancam/.trash/__MACOSX/../admin/./model/tool/backup.php