summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2010-02-20 15:10:31 +0000
committerSteve Dibb <beandog@gentoo.org>2010-02-20 15:10:31 +0000
commitcc2a6584e489b736560104fd9d0a9091895a6779 (patch)
tree66d08674797f59c2eac1be16d102dea3866b0fae /import.all.php
parentUpdate recent_changes (diff)
downloadznurt-org-backend-cc2a6584e489b736560104fd9d0a9091895a6779.tar.gz
znurt-org-backend-cc2a6584e489b736560104fd9d0a9091895a6779.tar.bz2
znurt-org-backend-cc2a6584e489b736560104fd9d0a9091895a6779.zip
Track import status in DB
git-svn-id: file:///var/svn/portage@92 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
Diffstat (limited to 'import.all.php')
-rw-r--r--import.all.php7
1 files changed, 7 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";
}
}