示例#1
0
                     $restore_query = ltrim(substr($restore_query, $i + 1));
                     $sql_length = strlen($restore_query);
                     $i = strpos($restore_query, ';') - 1;
                     if (preg_match('/^create*/i', $query)) {
                         $table_name = trim(substr($query, stripos($query, 'table ') + 6));
                         $table_name = substr($table_name, 0, strpos($table_name, ' '));
                         $drop_table_names[] = $table_name;
                     }
                 }
             }
         }
         tep_db_query('drop table if exists ' . implode(', ', $drop_table_names));
         for ($i = 0, $n = sizeof($sql_array); $i < $n; $i++) {
             tep_db_query($sql_array[$i]);
         }
         tep_session_close();
         tep_db_query("delete from " . TABLE_WHOS_ONLINE);
         tep_db_query("delete from " . TABLE_SESSIONS);
         tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " values (null, 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '0', null, now(), '', '')");
         if (isset($remove_raw) && $remove_raw == true) {
             unlink($restore_from);
         }
         $messageStack->add_session(SUCCESS_DATABASE_RESTORED, 'success');
     }
     tep_redirect(tep_href_link(FILENAME_BACKUP));
     break;
 case 'download':
     $extension = substr($_GET['file'], -3);
     if ($extension == 'zip' || $extension == '.gz' || $extension == 'sql') {
         if ($fp = fopen(DIR_FS_BACKUP . $_GET['file'], 'rb')) {
示例#2
0
function tep_exit()
{
    tep_session_close();
    exit;
}
示例#3
0
function tep_exit()
{
    tep_session_close();
    tep_db_close();
    die;
}