diff options
-rw-r--r-- | import.all.php | 7 | ||||
-rw-r--r-- | import.final.php | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/import.all.php b/import.all.php index 73b95f8..39c296c 100644 --- a/import.all.php +++ b/import.all.php @@ -24,6 +24,10 @@ $db->query($sql); } + $sql = "INSERT INTO import_status (status) VALUES ('start');"; + $db->query($sql); + $import_id = $db->lastInsertID(); + // FIXME these could be accidentally overwritten in one of the includes $base = true; $packages = true; @@ -51,6 +55,9 @@ file_put_contents("/tmp/znurt/status", "$file\n"); } + $sql = "UPDATE import_status SET status = ".$db->quote($file).", udate = NOW() WHERE id = ".$db->quote($import_id).";"; + $db->query($sql); + include "import.$file.php"; } } diff --git a/import.final.php b/import.final.php index c2cf5da..eca6253 100644 --- a/import.final.php +++ b/import.final.php @@ -81,4 +81,10 @@ print_r($hits); } + // Update status + if($import_id) { + $sql = "UPDATE import_status SET status = 'finish', udate = NOW() WHERE id = ".$db->quote($import_id).";"; + $db->query($sql); + } + ?>
\ No newline at end of file |