[Comoblog-commit] comoblog/_install patch_0.php,NONE,1.1 patch_1.php,NONE,1.1 patch_2.php,NONE,1.1 u
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2005-12-22 05:30:28
|
Update of /cvsroot/comoblog/comoblog/_install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16310/_install Modified Files: upgrade_0.php upgrade_1.php Added Files: patch_0.php patch_1.php patch_2.php Log Message: 1378108 - DB data changes in point version upgrades now supported Index: upgrade_0.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/_install/upgrade_0.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- upgrade_0.php 9 Oct 2005 14:11:35 -0000 1.1 +++ upgrade_0.php 22 Dec 2005 05:30:18 -0000 1.2 @@ -11,9 +11,13 @@ $ver = $row[0]; // Check supported upgrade versions. -if ($ver == "0.5.1") +if (in_supported_upgrade_list($ver))) { - $tpl->assign('VERSION', "Easymoblog 0.5.1"); + if ($ver == "0.5.1") + $tpl->assign('VERSION', "Easymoblog ".$ver); + else + $tpl->assign('VERSION', "CoMoblog ".$ver); + $tpl->parse('main.upgrade'); } else --- NEW FILE: patch_1.php --- <?php require ('../include/xtemplate.inc.php'); require_once (dirname(__FILE__).'/../include/config.inc.php'); $query = "select pref_value from ".CFG_MYSQL_TABPREFIX."preferences where pref_name='CFG_VERSION'"; $res = mysql_query($query); $row = mysql_fetch_array($res, MYSQL_NUM); $ver = $row[0]; $errors = array(); if ($ver = "1.0") $errors = run_script(dirname(__FILE__)."/upgrades/1.0_to_1.1.xml"); if (count($errors) == 0) { Header ('Location: patch_2.php'); } else { $tpl = @new XTemplate ('templates/patch_1.tpl.htm', 'main'); foreach ($errors as $k => $v) { $tpl->assign('ERROR', $v); $tpl->parse('main.errors.error'); } $tpl->parse('main.errors'); $tpl->parse('main'); $tpl->out('main'); } ?> --- NEW FILE: patch_2.php --- <?php require ('../include/xtemplate.inc.php'); require_once (dirname(__FILE__).'/../include/config.inc.php'); $tpl = @new XTemplate ('templates/patch_2.tpl.htm', 'main'); $tpl->assign('SITE_URL', CFG_SITE_URL); $tpl->assign('BASE_PATH', CFG_BASE_PATH); $tpl->assign('WIN_BASE_PATH', str_replace('/','\\',CFG_BASE_PATH)); $tpl->assign('ADMIN_USERNAME', CFG_ADMIN_USERNAME); session_start(); $tpl->assign('ADMIN_PW', $_SESSION['admin_pw']); $allowed_from = explode (',', CFG_ALLOWED_FROM); if (CFG_ALLOWED_FROM == '') { $tpl->assign('ALLOWED_FROM', 'everybody'); $tpl->parse('main.allowed_from'); } else { for ($c = 0; $c < count($allowed_from); $c++) { $tpl->assign('ALLOWED_FROM', $allowed_from[$c]); $tpl->parse('main.allowed_from'); } } $tpl->parse('main'); $tpl->out('main'); ?> --- NEW FILE: patch_0.php --- <?php require ('../include/xtemplate.inc.php'); require_once (dirname(__FILE__).'/../include/config.inc.php'); $tpl = @new XTemplate ('templates/patch.tpl.htm', 'main'); $query = "select pref_value from ".CFG_MYSQL_TABPREFIX."preferences where pref_name='CFG_VERSION'"; $res = mysql_query($query); $row = mysql_fetch_array($res, MYSQL_NUM); $ver = $row[0]; $file_version = file(dirname(__FILE__).'/../VERSION'); if (!in_supported_patch_list(CFG_VERSION)) { Header ('Location: _install/upgrade_0.php'); exit; } // Check supported upgrade versions. $tpl->assign('CURRENT', CFG_VERSION); $tpl->assign('PATCH', $file_version[0]); $tpl->parse('main'); $tpl->out('main'); ?> Index: upgrade_1.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/_install/upgrade_1.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- upgrade_1.php 9 Oct 2005 14:11:35 -0000 1.1 +++ upgrade_1.php 22 Dec 2005 05:30:18 -0000 1.2 @@ -10,8 +10,9 @@ $errors = array(); -if ($ver = "0.5.1") - $errors = run_script(dirname(__FILE__)."/upgrades/0.5.1_to_1.0.xml"); +$current_ver = file(dirname(__FILE__).'/../VERSION')[0]; + +$errors = run_script(dirname(__FILE__)."/upgrades/".$ver."_to_".$current_ver.".xml"); if (count($errors) == 0) { |