install
[ class tree: install ] [ index: install ] [ all elements ]

Source for file upgrade.php

Documentation is available at upgrade.php

  1. <?php
  2. /**
  3.  * Page script - run an update process.
  4.  *
  5.  * @package install
  6.  * @subpackage upgrade
  7.  */
  8.  
  9. /**
  10.  * @copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  11.  *  All Rights Reserved. See below for details and a complete list of authors.
  12.  *  Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
  13.  */
  14.  
  15. /**
  16.  * required setup
  17.  */
  18. require_once( 'install_inc.php' );
  19.  
  20. // this variable will be appended to the template file called - useful for displaying messages after data input
  21. $app = '';
  22.  
  23. // work out where in the installation process we are
  24. if( !isset( $_REQUEST['step'] ) ) {
  25.     $_REQUEST['step'] = 0;
  26. } elseif( $_REQUEST['step'] == '0' ) {
  27.     $_SESSION['upgrade_r1'] = NULL;
  28. }
  29. $step = $_REQUEST['step'];
  30.  
  31. // updating $install_file name
  32. $i = 0;
  33. $install_file[$i]['file'] = 'welcome';
  34. $install_file[$i]['name'] = 'Welcome';
  35. $i++;
  36. $install_file[$i]['file'] = 'database';
  37. $install_file[$i]['name'] = 'Database Connection';
  38. $i++;
  39. $install_file[$i]['file'] = 'packages';
  40. $install_file[$i]['name'] = 'Upgrade Selection';
  41. $i++;
  42. $install_file[$i]['file'] = 'final';
  43. $install_file[$i]['name'] = 'Upgrade Complete';
  44.  
  45. // currently i can't think of a better way to secure the upgrade pages
  46. // redirect to the installer if we aren't sent here by the installer and the upgrade session variable hasn't been set
  47. if( !isset( $_SESSION['upgrade'] ) || $_SESSION['upgrade'] != TRUE ||
  48.     !isset( $_SERVER['HTTP_REFERER'] ) ||
  49.     isset( $_SERVER['HTTP_REFERER'] ) &&
  50.     ( ( !strpos( $_SERVER['HTTP_REFERER'],'install/install.php' ) ) && ( !strpos( $_SERVER['HTTP_REFERER'],'install/upgrade.php' ) ) && ( !strpos( $_SERVER['HTTP_REFERER'],'install/migrate.php' ) ) )
  51. ) {
  52.     header( 'Location: '.INSTALL_PKG_URL.'install.php' );
  53.     die;
  54. }
  55. // For MySql only, if server supports InnoDB Engine and
  56. // if it was selected as storage type, we set a session var
  57. // for use in update_packages.php
  58. if( isset( $_REQUEST['use_innodb'] ) ) {
  59.     $_SESSION['use_innodb'] = TRUE;
  60. }
  61.  
  62. /**
  63.  * process upgrade step
  64.  */
  65. include_once( 'upgrade_'.$install_file[$step]['file'].'.php' );
  66.  
  67. $install_file = set_menu( $install_file, $step );
  68.  
  69. $gBitSmarty->assign( 'menu_file', 'upgrade.php' );
  70. $gBitSmarty->assign( 'section', 'Upgrade' );
  71.  
  72. $gBitSmarty->assign( 'install_file', INSTALL_PKG_PATH."templates/upgrade_".$install_file[$step]['file'].$app.".tpl" );
  73. $gBitInstaller->in_display( $install_file[$step]['name'], INSTALL_PKG_PATH.'templates/install.tpl' );
  74.  
  75. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:30 +0000 by phpDocumentor 1.5.0-lsces