$crash->field = $crashdata[1];
$crash->record = $crashdata[2];
- print_heading('Resume information :');
- echo '<br>Resuming from @ table : '.$crash->table;
- echo '<br>Resuming from @ field : '.$crash->field;
- echo '<br>Resuming from @ record : '.$crash->record;
+ notify("Resuming migration from: $crash->table / .$crash->field, Record: $crash->record");
}
/************************************************************************
continue;
} else {
$crash = 0;
- print_heading('recovering from '.$dbtablename.'--'.$fieldname.'--'.$record->id);
}
}
$processedrecords++;
//print some output once in a while
if (($processedrecords) % 5000 == 0) {
- echo 'Processing...'.$dbtablename.'...'.$fieldname.'...'.$record->id;
+ print_progress($done, $tablestoconvert, 5, 1,
+ 'Processing: '.$dbtablename.'/'.$fieldname.' ');
}
}
}else {
return true;
}
-function print_progress($done, $total, $updatetime=5, $sleeptime=1) {
- static $count;
+function print_progress($done, $total, $updatetime=5, $sleeptime=1, $donetext='') {
static $starttime;
static $lasttime;
echo '</div>';
}
- if (!isset($count)) {
- $count = 0;
- }
-
- $count++;
-
$now = time();
if ($done && (($now - $lasttime) >= $updatetime)) {
$percentage = format_float((float)$done / (float)$total, 2);
$width = (int)(500 * $percentage);
+ if ($projectedtime > 10) {
+ $projectedtext = ' Ending: '.format_time($projectedtime);
+ } else {
+ $projectedtext = '';
+ }
+
echo '<script>';
- echo 'document.getElementById("text").innerHTML = "'.$count.' done. Ending: '.format_time($projectedtime).'";'."\n";
+ echo 'document.getElementById("text").innerHTML = "'.addslashes($donetext).' '.$done.' done.'.$projectedtext.'";'."\n";
echo 'document.getElementById("slider").style.width = \''.$width.'px\';'."\n";
echo '</script>';