2 /* vim: set expandtab sw=4 ts=4 sts=4: */
9 if (! defined('PHPMYADMIN')) {
13 $ID_KEY = 'APC_UPLOAD_PROGRESS';
15 function PMA_getUploadStatus($id) {
19 if (trim($id) == "") {
22 if (! array_key_exists($id, $_SESSION[$SESSION_KEY])) {
23 $_SESSION[$SESSION_KEY][$id] = array(
32 $ret = $_SESSION[$SESSION_KEY][$id];
34 if (! PMA_import_apcCheck() ||
$ret['finished']) {
37 $status = apc_fetch('upload_' . $id);
40 $ret['finished'] = (bool)$status['done'];
41 $ret['total'] = $status['total'];
42 $ret['complete'] = $status['current'];
44 if ($ret['total'] > 0) {
45 $ret['percent'] = $ret['complete'] / $ret['total'] * 100;
48 if ($ret['percent'] == 100) {
49 $ret['finished'] = (bool)true;
52 $_SESSION[$SESSION_KEY][$id] = $ret;