diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 04:51:19 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 04:51:19 +0000 |
| commit | f2c6619fcf9489f34354efe9a9eab3dd73db773e (patch) | |
| tree | 8640b8d4ca95a864be32d785a4b31d64ef46032f /install.php | |
| download | install-f2c6619fcf9489f34354efe9a9eab3dd73db773e.tar.gz install-f2c6619fcf9489f34354efe9a9eab3dd73db773e.tar.bz2 install-f2c6619fcf9489f34354efe9a9eab3dd73db773e.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'install.php')
| -rw-r--r-- | install.php | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/install.php b/install.php new file mode 100644 index 0000000..9bb9f50 --- /dev/null +++ b/install.php @@ -0,0 +1,126 @@ +<?php + +// $Header: /cvsroot/bitweaver/_bit_install/install.php,v 1.1 2005/06/19 04:51:18 bitweaver Exp $ + +// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. +// All Rights Reserved. See copyright.txt for details and a complete list of authors. +// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. + +// hide error ouptut on database connection settings page +if( isset( $_REQUEST['step'] ) && $_REQUEST['step'] == '3' ) { + ini_set( 'display_errors', '0' ); +} +require_once( 'install_inc.php' ); + +// this variable will be appended to the template file called - useful for displaying messages after data input +$app = ''; + +// work out where in the installation process we are +if( !isset( $_REQUEST['step'] ) ) { + $_REQUEST['step'] = 0; +} +$step = $_REQUEST['step']; + +// for pages that should only be shown during a first install +if( ( empty( $gBitDbType ) || !$gBitUser->isAdmin() ) || ( $_SESSION['first_install'] ) ) { + $onlyDuringFirstInstall = TRUE; +} else { + $onlyDuringFirstInstall = FALSE; +} + +// updating $install_file name +$i = 0; +$install_file[$i]['file'] = 'welcome'; +$install_file[$i++]['name'] = 'Welcome'; +$install_file[$i]['file'] = 'checks'; +$install_file[$i++]['name'] = 'bitweaver Settings Check'; +// Upgrading of a database can only occur during a first install +if( $onlyDuringFirstInstall ) { + $install_file[$i]['file'] = 'upgrade'; + $install_file[$i++]['name'] = 'Database Upgrade'; +} +// make it possible to reset the config_inc.php file if it's already filled with data +if( $onlyDuringFirstInstall ) { + $install_file[$i]['file'] = 'database'; + $install_file[$i++]['name'] = 'Database Connection'; +} else { + $install_file[$i]['file'] = 'database_reset'; + $install_file[$i++]['name'] = 'Database Connection'; +} +// if the admin is already set up and we are not installing for the first time, we skip admin creation page +if( $onlyDuringFirstInstall ) { + $install_file[$i]['file'] = 'admin_inc'; + $install_file[$i++]['name'] = 'Admin Setup'; +} +$install_file[$i]['file'] = 'packages'; +$install_file[$i++]['name'] = 'Package Installation'; +// these settings should only be present when we are installing for the first time +if( $onlyDuringFirstInstall ) { + $install_file[$i]['file'] = 'bit_settings'; + $install_file[$i++]['name'] = 'bitweaver Settings'; + // only show db population page when we haven't just done an upgrade + if( !isset( $_SESSION['upgrade'] ) ) { + $install_file[$i]['file'] = 'data'; + $install_file[$i++]['name'] = 'Database Population'; + } +} else { + $install_file[$i]['file'] = 'beta1_beta2'; + $install_file[$i++]['name'] = 'Beta 1 --> Beta 2'; +} +$install_file[$i]['file'] = 'final'; +$install_file[$i]['name'] = 'Installation Complete'; +//don't increment last $i since it's used later on + +// if we have to log in, call login template and die +if( !empty( $gBitDbType ) && $gBitInstaller->isPackageActive( 'users' ) && !$gBitUser->isAdmin() && !$_SESSION['first_install'] ) { + $install_file = 'login'; + $smarty->assign( 'install_file', INSTALL_PKG_PATH."templates/install_".$install_file.".tpl" ); + $smarty->display( INSTALL_PKG_PATH.'templates/install.tpl' ); + die; +} + +// if the page has been renamed to anything else than 'install.php' we send it to the last installation stage +if( !strpos( $_SERVER['PHP_SELF'],'install/install.php' ) ) { + $step = $i; + $smarty->assign( 'renamed',basename( $_SERVER['PHP_SELF'] ) ); +} + +// finally we are ready to include the actual php file +include_once( 'install_'.$install_file[$step]['file'].'.php' ); + +// here we set up the menu +for( $done = 0; $done < $step; $done++ ) { + $install_file[$done]['state'] = 'success'; +} + +// if the page is done, we can display the menu item as done and increase the progress bar +if( $app == "_done" ) { + $install_file[$step]['state'] = 'success'; + $done++; +} elseif( $failedcommands || isset( $warning ) ) { + $install_file[$step]['state'] = 'warning'; +} elseif( isset( $error ) ) { + $install_file[$step]['state'] = 'error'; +} else { + $install_file[$step]['state'] = 'current'; +} + +foreach( $install_file as $key => $menu_step ) { + if( !isset( $menu_step['state'] ) ) { + if( !empty( $gBitDbType ) && $gBitUser->isAdmin() && !$_SESSION['first_install'] ) { + $install_file[$key]['state'] = 'success'; + } else { + $install_file[$key]['state'] = 'spacer'; + } + } +} +$smarty->assign( 'step', $step ); +$smarty->assign( 'menu_steps', $install_file ); + +$steps = ( count( $install_file ) ); +$progress = ( ceil( 100 / $steps * $done ) ); +$smarty->assign( 'progress', $progress ); + +$smarty->assign( 'install_file', INSTALL_PKG_PATH."templates/install_".$install_file[$step]['file'].$app.".tpl" ); +$gBitInstaller->display( INSTALL_PKG_PATH.'templates/install.tpl', $install_file[$step]['name'] ); +?> |
