2 error_reporting(E_ALL);
4 include_once("config.php"); /* needs to be first in list, since other includes use this */
5 include_once("./include/db.php"); /* database only */
6 include_once("./include/functions.php"); /* the rest */
8 /* make sure that user has set all variables in config.php */
11 /* open the database */
15 /* only callable via cron or CLI */
16 if(isset($_SERVER['REMOTE_ADDR']))
19 $old_version = DB_get_version();
22 if($old_version < $current_version)
23 echo "Will upgrade your database now:\n";
25 echo "You are up to date (version ${current_version}), nothing to do.\n";
30 /* add database for digesting */
31 DB_query("CREATE TABLE digest_email (".
32 " `id` int(11) NOT NULL auto_increment,".
33 " `email` varchar(255) default null,".
34 " `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',".
36 " UNIQUE KEY `id` (`id`),".
38 DB_query("UPDATE Version set version=1");
39 echo "Upgraded to version 1.\n";