/** * update DB version and sugar_version.php */ function upgradeDbAndFileVersion($version) { global $instancePath; if (!isset($instancePath) && isset($_SESSION['instancePath'])) { $instancePath = $_SESSION['instancePath']; } if (!function_exists('updateVersions')) { if (file_exists('modules/UpgradeWizard/uw_utils.php')) { require_once 'modules/UpgradeWizard/uw_utils.php'; } elseif (file_exists($instancePath . '/modules/UpgradeWizard/uw_utils.php')) { require_once $instancePath . '/modules/UpgradeWizard/uw_utils.php'; } } updateVersions($version); }
/** * handles post-install tasks */ function commitAjaxPostInstall($persistence) { global $mod_strings; global $sugar_config; global $sugar_version; if (empty($sugar_version)) { require 'sugar_version.php'; } // update versions info if (!updateVersions($sugar_version)) { echo $mod_strings['ERR_UW_COMMIT_UPDATE_VERSIONS']; } logThis('Starting post_install()...'); $postInstallResults = "<b>{$mod_strings['LBL_UW_COMMIT_POSTINSTALL_RESULTS']}</b><br />\n\t\t\t\t\t\t\t<a href='javascript:toggleNwFiles(\"postInstallResults\");'>{$mod_strings['LBL_UW_SHOW']}</a><br />\n\t\t\t\t\t\t\t<div id='postInstallResults' style='display:none'>"; $file = $persistence['unzip_dir'] . "/" . constant('SUGARCRM_POST_INSTALL_FILE'); if (is_file($file)) { include $file; ob_start(); post_install(); } require "sugar_version.php"; if (!rebuildConfigFile($sugar_config, $sugar_version)) { logThis('*** ERROR: could not write config.php! - upgrade will fail!'); $errors[] = $mod_strings['ERR_UW_CONFIG_WRITE']; } $res = ob_get_contents(); $postInstallResults .= empty($res) ? $mod_strings['LBL_UW_SUCCESS'] : $res; $postInstallResults .= "</div>"; ob_start(); echo $postInstallResults; ob_flush(); logThis('post_install() done.'); }
if ($moved) { echo "*** {$moved} customized files were moved aside, please check them in {$backup_dir}. Please see {$logpath} for more details."; } // reenable Shadow ini_set('shadow.enabled', 1); ////////////////COMMIT PROCESS BEGINS/////////////////////////////////////////////////////////////// $trackerManager = TrackerManager::getInstance(); $trackerManager->pause(); $trackerManager->unsetMonitors(); //Clean smarty from cache @deleteCache(); upgrade_check_errors($errors); // Run SQL upgrades runSqlFiles($origVersion, $destVersion); // Set new version updateVersions($sugar_version); /////////////////////////////////////////////////////////////////////////////// //// HANDLE DATABASE writeLog('About to repair DB tables.'); //Use Repair and rebuild to update the database. repairTables(); writeLog('DB tables repaired'); if ($ce_to_pro_ent) { // Add languages if (is_file('install/lang.config.php')) { writeLog('install/lang.config.php exists lets import the file/array insto sugar_config/config.php'); require_once 'install/lang.config.php'; foreach ($config['languages'] as $k => $v) { $sugar_config['languages'][$k] = $v; } } else {