From: paulr Date: Tue, 26 Apr 2011 15:19:12 +0000 (+1000) Subject: the start of the auto-update code X-Git-Url: http://git.pjr.cc/?p=glcas.git;a=commitdiff_plain;h=e3440bbebb27ae9aa552e8ee13ab3c606d7ee13e the start of the auto-update code --- diff --git a/lib/lib.php b/lib/lib.php index 63462fe..dde9335 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -4,6 +4,9 @@ require_once("config.php"); require_once("wsdl.php"); require_once("www.php"); require_once("db.php"); +require_once("messages.php"); +require_once("datastore.php"); +require_once("updates.php"); // first and foremost, load the plugins $basedir = dirname(__FILE__); @@ -46,4 +49,7 @@ function urlInterpretter() } } } + +$db = db_getDB(); +db_createTable("options", "option_name", "option_value"); ?> \ No newline at end of file diff --git a/lib/updates.php b/lib/updates.php new file mode 100644 index 0000000..8e92481 --- /dev/null +++ b/lib/updates.php @@ -0,0 +1,48 @@ + $timerval) { + up_doUpdateCheck(); + } +} +//echo "timerval: $timerval\n"; + +function up_doUpdateCheck() +{ + echo "do update check and reset interval\n"; + + // db_updateData($tablename, $column, $newdata, $wherecol, $wheredata, $exact=true) + $ctime = time(); + + db_updateData("options", "option_value", "$ctime", "option_name", "update.check.last"); +} +?> \ No newline at end of file diff --git a/unittests/libload.php b/unittests/libload.php new file mode 100644 index 0000000..bf99490 --- /dev/null +++ b/unittests/libload.php @@ -0,0 +1,5 @@ + \ No newline at end of file