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

Source for file install.php

Documentation is available at install.php

  1. <?php
  2. /**
  3.  * @version $Header: /cvsroot/bitweaver/_bit_install/install.php,v 1.13 2007/01/11 08:41:37 squareing Exp $
  4.  * @package install
  5.  * @subpackage functions
  6.  */
  7.  
  8. // hide errors when trying to connect to the database. very unsettling when you 
  9. // have pages of errors to scroll through
  10.  
  11. if!empty$_REQUEST['submit_db_info'&& !empty$_REQUEST['step'&& $_REQUEST['step'== {
  12.     ini_set'display_errors''0' );
  13. }
  14.  
  15. // here we force the use of adodb during installation
  16. $gForceAdodb TRUE;
  17.  
  18. /**
  19.  * required setup
  20.  */
  21. require_once'install_inc.php' );
  22.  
  23. // this variable will be appended to the template file called - useful for displaying messages after data input
  24. $app '';
  25.  
  26. // work out where in the installation process we are
  27. if!isset$_REQUEST['step') ) {
  28.     $_REQUEST['step'0;
  29. }
  30. $step $_REQUEST['step'];
  31.  
  32. if!empty$_REQUEST['reload') ) {
  33.     header"Location: ".$_SERVER['HTTP_REFERER');
  34. }
  35.  
  36. // for pages that should only be shown during a first install
  37. if( ( empty$gBitDbType || !$gBitUser->isAdmin() ) || $_SESSION['first_install') ) {
  38.     $onlyDuringFirstInstall TRUE;
  39. else {
  40.     $onlyDuringFirstInstall FALSE;
  41. }
  42.  
  43. // updating $install_file name
  44. $i 0;
  45. $install_file[$i]['file''welcome';
  46. $install_file[$i++]['name''Welcome';
  47. $install_file[$i]['file''checks';
  48. $install_file[$i++]['name''bitweaver Settings Check';
  49. // Upgrading of a database can only occur during a first install
  50. if$onlyDuringFirstInstall {
  51.     $install_file[$i]['file''options';
  52.     $install_file[$i++]['name''Install Options';
  53. }
  54. // make it possible to reset the config_inc.php file if it's already filled with data
  55. if$onlyDuringFirstInstall {
  56.     $install_file[$i]['file''database';
  57.     $install_file[$i++]['name''Database Connection';
  58. else {
  59.     $install_file[$i]['file''database_reset';
  60.     $install_file[$i++]['name''Database Connection';
  61. }
  62. // if the admin is already set up and we are not installing for the first time, we skip admin creation page
  63. if$onlyDuringFirstInstall {
  64.     $install_file[$i]['file''admin_inc';
  65.     $install_file[$i++]['name''Admin Setup';
  66. }
  67. $install_file[$i]['file''packages';
  68. $install_file[$i++]['name''Package Installation';
  69. $install_file[$i]['file''cleanup';
  70. $install_file[$i++]['name''Resolve Conflicts';
  71. // these settings should only be present when we are installing for the first time
  72. if$onlyDuringFirstInstall {
  73.     $install_file[$i]['file''bit_settings';
  74.     $install_file[$i++]['name''bitweaver Settings';
  75.     // only show db population page when we haven't just done an upgrade
  76.     if!isset$_SESSION['upgrade') ) {
  77.         $install_file[$i]['file''datapump';
  78.         $install_file[$i++]['name''Database Population';
  79.     }
  80. }
  81. $install_file[$i]['file''final';
  82. $install_file[$i]['name''Installation Complete';
  83. //don't increment last $i since it's used later on
  84. // if we have to log in, call login template and die
  85.  
  86. if!empty$gBitDbType && !empty$gBitInstaller->mPackages['users']['installed'&& !$gBitUser->isAdmin(&& !$_SESSION['first_install'{
  87.     $install_file 'login';
  88.     $gBitSmarty->assign'install_file'INSTALL_PKG_PATH."templates/install_".$install_file.".tpl" );
  89.     $gBitSmarty->displayINSTALL_PKG_PATH.'templates/install.tpl' );
  90.     die;
  91. }
  92.  
  93. // if the page has been renamed to anything else than 'install.php' we send it to the last installation stage
  94. if!strpos$_SERVER['PHP_SELF'],'install/install.php' ) ) {
  95.     $step $i;
  96.     $gBitSmarty->assign'renamed',basename$_SERVER['PHP_SELF') );
  97. }
  98.  
  99. // finally we are ready to include the actual php file
  100. include_once'install_'.$install_file[$step]['file'].'.php' );
  101.  
  102. $install_file set_menu$install_file$step );
  103.  
  104. $gBitSmarty->assign'install_file'INSTALL_PKG_PATH."templates/install_".$install_file[$step]['file'].$app.".tpl" );
  105. $gBitInstaller->displayINSTALL_PKG_PATH.'templates/install.tpl'$install_file[$step]['name');
  106. ?>

Documentation generated on Thu, 15 Feb 2007 20:41:20 +0000 by phpDocumentor 1.3.0