From: Jason Woofenden Date: Thu, 12 Nov 2015 21:03:31 +0000 (-0500) Subject: add db_upgrade system X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl-cms.git;a=commitdiff_plain;h=cd38e5f5860aa72e8d0548a7ae3d8489aec48062 add db_upgrade system --- diff --git a/config.php b/config.php index e60cbd7..59b1c98 100644 --- a/config.php +++ b/config.php @@ -29,3 +29,9 @@ require_once(DOCROOT . 'inc/misc.php'); # Connect to the database db_connect(WFPL_DB, WFPL_DB_USER, WFPL_DB_PASS); + +# upgrade db (only) on special trigger (assures only one upgrade at a time) +if (isset($_SERVER['HTTP_X_UPGRADE_DB_NOW'])) { + require_once(DOCROOT . 'inc/db_upgrade.php'); + db_upgrade(); +} diff --git a/inc/db_upgrade.php b/inc/db_upgrade.php new file mode 100644 index 0000000..07c633f --- /dev/null +++ b/inc/db_upgrade.php @@ -0,0 +1,49 @@ +