Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

477
 
1274
 
1274
 
backup.php
_> 7373 
  7474             if (!isset($index[$kname])) {
  7575               $index[$kname] = array('unique' => !$keys['Non_unique'],
<>  76+                                     'fulltext' => ($keys['Index_type'] == 'FULLTEXT' ? '1' : '0'),
7677                                      'columns' => array());
  7778             }
  7879 
     
 !
8687 
  8788             if ($kname == 'PRIMARY') {
  8889               $schema .= '  PRIMARY KEY (' . $columns . ')';
<>  90+            } elseif ( $info['fulltext'] == '1' ) {
   91+              $schema .= '  FULLTEXT ' . $kname . ' (' . $columns . ')';
8992             } elseif ($info['unique']) {
  9093               $schema .= '  UNIQUE ' . $kname . ' (' . $columns . ')';
  9194             } else {
     
 !
97100           fputs($fp, $schema);
  98101 
  99102 // dump the data
<> 100 -          $rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table);
  101 -          while ($rows = tep_db_fetch_array($rows_query)) {
  102 -            $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values (';
   103+          if ( ($table != TABLE_SESSIONS ) && ($table != TABLE_WHOS_ONLINE) ) {
   104+            $rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table);
   105+            while ($rows = tep_db_fetch_array($rows_query)) {
   106+              $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values (';
103107 
<> 104 -            reset($table_list);
  105 -            while (list(,$i) = each($table_list)) {
  106 -              if (!isset($rows[$i])) {
  107 -                $schema .= 'NULL, ';
  108 -              } elseif (tep_not_null($rows[$i])) {
  109 -                $row = addslashes($rows[$i]);
  110 -                $row = ereg_replace("\n#", "\n".'\#', $row);
   108+              reset($table_list);
   109+              while (list(,$i) = each($table_list)) {
   110+                if (!isset($rows[$i])) {
   111+                  $schema .= 'NULL, ';
   112+                } elseif (tep_not_null($rows[$i])) {
   113+                  $row = addslashes($rows[$i]);
   114+                  $row = ereg_replace("\n#", "\n".'\#', $row);
111115 
<> 112 -                $schema .= '\'' . $row . '\', ';
  113 -              } else {
  114 -                $schema .= '\'\', ';
   116+                  $schema .= '\'' . $row . '\', ';
   117+                } else {
   118+                  $schema .= '\'\', ';
   119+                }
115120               }
<> 116 -            }
117121 
<> 118 -            $schema = ereg_replace(', $', '', $schema) . ');' . "\n";
  119 -            fputs($fp, $schema);
  120 -
   122+              $schema = ereg_replace(', $', '', $schema) . ');' . "\n";
   123+              fputs($fp, $schema);
   124+            }
121125           }
  122126         }
  123127 
     
 !
250254             tep_db_query($sql_array[$i]);
  251255           }
  252256 
<>  257+          tep_session_close();
   258+
   259+          tep_db_query("delete from " . TABLE_WHOS_ONLINE);
   260+          tep_db_query("delete from " . TABLE_SESSIONS);
   261+
<_ 253262           tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
  254263           tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '', '', now(), '', '')");
  255264