pause(); $trackerManager->unsetMonitors(); $_SESSION['upgrade_complete'] = ''; $_REQUEST['upgradeWizard'] = true; logThis('[At commit.php]'); $stop = true; // flag to show "next" //refreshing mod_strings global $mod_strings; $curr_lang = 'en_us'; if(isset($GLOBALS['current_language']) && ($GLOBALS['current_language'] != null)){ $curr_lang = $GLOBALS['current_language']; } return_module_language($curr_lang, 'UpgradeWizard', true); $standardErrorLevel = error_reporting(); logThis("Setting error_reporting() to E_ERROR while running upgrade"); error_reporting(E_ERROR); set_time_limit(0); /* * [unzip_dir] => /Users/curisu/www/head/cache/upload//upgrades/temp/QSugp3 * [zip_from_dir] => SugarEnt-Upgrade-4.0.1-to-4.2.1 * rest_dir: /Users/curisu/www/head/cache/upload/SugarEnt-Upgrade-4.0.1-to-4.2.1-restore */ // flag upgradeSql script run method $_SESSION['schema_change'] = $_REQUEST['schema_change']; if(didThisStepRunBefore('commit')){ $_SESSION['committed'] = true; } else{ set_upgrade_progress('commit','in_progress','commit','in_progress'); } //Initialize session errors array if(!isset($_SESSION['sqlSkippedQueries']) && !is_array($_SESSION['sqlSkippedQueries'])){ $_SESSION['sqlSkippedQueries'] = array(); } // prevent "REFRESH" double commits if(!isset($_SESSION['committed'])) { //$_SESSION['committed'] = true; // flag to prevent refresh double-commit //set the flag at the end though unset($_SESSION['rebuild_relationships']); unset($_SESSION['rebuild_extensions']); //put checks for follwing files if(!isset($_SESSION['unzip_dir']) || empty($_SESSION['unzip_dir'])) { logThis('unzipping files in upgrade archive...'); $errors = array(); list($base_upgrade_dir, $base_tmp_upgrade_dir) = getUWDirs(); $unzip_dir = ''; //also come up with mechanism to read from upgrade-progress file if(!isset($_SESSION['install_file']) || empty($_SESSION['install_file']) || !is_file($_SESSION['install_file'])) { if (file_exists(clean_path($base_tmp_upgrade_dir)) && $handle = opendir(clean_path($base_tmp_upgrade_dir))) { while (false !== ($file = readdir($handle))) { if($file !="." && $file !="..") { //echo $base_tmp_upgrade_dir."/".$file.''; if(is_file($base_tmp_upgrade_dir."/".$file."/manifest.php")){ require_once($base_tmp_upgrade_dir."/".$file."/manifest.php"); $package_name= $manifest['copy_files']['from_dir']; //echo file_exists($base_tmp_upgrade_dir."/".$file."/".$package_name).''; if(file_exists($base_tmp_upgrade_dir."/".$file."/".$package_name) && file_exists($base_tmp_upgrade_dir."/".$file."/scripts") && file_exists($base_tmp_upgrade_dir."/".$file."/manifest.php")){ //echo 'Yeah this the directory '. $base_tmp_upgrade_dir."/".$file; $unzip_dir = $base_tmp_upgrade_dir."/".$file; if(file_exists("$base_upgrade_dir/patch/".$package_name.'.zip')){ $_SESSION['install_file'] = $package_name.'.zip'; break; } } } } } } } if(!isset($_SESSION['install_file']) || empty($_SESSION['install_file'])){ unlinkUWTempFiles(); resetUwSession(); echo 'Upload File not found so redirecting to Upgrade Start '; $redirect_new_wizard = $sugar_config['site_url' ].'/index.php?module=UpgradeWizard&action=index'; echo '