/version_info.php $versionInfo = 'v1.5.2'; print "\n\n------------------ ENSEMBLE UPDATE: OCTOBER 2, 2009, $versionInfo ----------------------\n"; print "--------------------------------------------------------------------------------\n\n"; /********************************************************************************************************* PREPARE UPGRADE Obtain ensemble root path, establish database connection, backup database */ include_once('../../include/variables.php'); include_once('./upgrade_functions.php'); // initialize variables and lists for the upgrade $ensroot = $ENSEMBLE_QEI_QPI_DIR; $variables_loc = $ensroot."/include/variables.php"; $variables_config_loc = $ensroot."/include/variables_config.php"; $version_info_loc = $ensroot."/include/version_info.php"; /********************************************************************************************************* PERFORM UPGRADE This upgrade is very simple. It just moves the $ENSEMBLE_VERSION variable from variables_config.php to version_info.php and adds an include statment to variables.php. */ print "WARNING: If you have installed Ensemble with svn, it is highly recommended that you\n"; print "run an 'svn update' on the root directory of Ensemble before proceeding.\n"; print "This upgrade will make changes to your Ensemble php files.\n"; print "It will not make changes to your Ensemble database.\n"; print "Make sure that you have an up-to-date backup of your Ensemble directory.\n"; print "Proceed with upgrade script "; $doProceed = userConfirm(); if(!$doProceed) { print "\nOK, EXITING SCRIPT\n\n"; die(); } print "\nRemoving \$ENSEMBLE_VERSION variable from variables_config.php if it is present..."; changeConfigFile($variables_config_loc,"ENSEMBLE_VERSION","",false); $variables_contents = file_get_contents($variables_loc); // see if include_once('version_info.php') was already added to variables.php // if so, leave variables.php alone. It is sufficient just to search for the text 'version_info.php' print "\nAdding include_once('version_info.php') to variables.php if necessary...\n"; if(strstr($variables_contents,"version_info.php")) { print "Reference to version_info.php found in variables.php. Leaving variables.php alone.\n\n"; } else { changeConfigFile($variables_loc,'include_once("version_info.php");','',false,"code"); } print "Creating version_info.php if necessary...\n"; if(!file_exists($version_info_loc)) { file_put_contents($version_info_loc,""); } else { print "version_info.php exists. Leaving this alone.\n\n"; }