info('Deleting Relationship Cache. Relationships will automatically refresh.'); echo "
"; $log->info('Rebuilding everything.'); require_once('ModuleInstall/ModuleInstaller.php'); $mi = new ModuleInstaller(); $mi->rebuild_all(); $query = "DELETE FROM versions WHERE name='Rebuild Extensions'"; $log->info($query); $db->query($query); // insert a new database row to show the rebuild extensions is done $id = create_guid(); $gmdate = TimeDate::getInstance()->nowDb(); $date_entered = db_convert("'$gmdate'", 'datetime'); $query = 'INSERT INTO versions (id, deleted, date_entered, date_modified, modified_user_id, created_by, name, file_version, db_version) ' . "VALUES ('$id', '0', $date_entered, $date_entered, '1', '1', 'Rebuild Extensions', '4.0.0', '4.0.0')"; $log->info($query); $db->query($query); } unset($_SESSION['rebuild_relationships']); unset($_SESSION['rebuild_extensions']); global $log, $db; // process commands if( !isset($_REQUEST['mode']) || ($_REQUEST['mode'] == "") ){ die($mod_strings['ERR_UW_NO_MODE']); } $mode = $_REQUEST['mode']; if( !isset($_REQUEST['version']) ){ die($mod_strings['ERR_UW_NO_MODE']); } $version = $_REQUEST['version']; if( !isset($_REQUEST['copy_count']) || ($_REQUEST['copy_count'] == "") ){ die($mod_strings['ERR_UW_NO_FILES']); } if( empty($_REQUEST['unzip_dir']) || $_REQUEST['unzip_dir'] == "." || $_REQUEST['unzip_dir'] == ".."){ die($mod_strings['ERR_UW_NO_TEMP_DIR']); } $unzip_dir = $base_tmp_upgrade_dir. "/". basename($_REQUEST['unzip_dir']); if(empty($_REQUEST['install_file'])){ die($mod_strings['ERR_UW_NO_INSTALL_FILE']); } $install_file = hashToFile($_REQUEST['install_file'] ); $install_type = getInstallType( $install_file ); $id_name = ''; if(isset($_REQUEST['id_name'])){ $id_name = $_REQUEST['id_name']; } $s_manifest = ''; if(isset($_REQUEST['s_manifest'])){ $s_manifest = $_REQUEST['s_manifest']; } $previous_version = ''; if(isset($_REQUEST['previous_version'])){ $previous_version = $_REQUEST['previous_version']; } $previous_id = ''; if(isset($_REQUEST['previous_id'])){ $previous_id = $_REQUEST['previous_id']; } if( $install_type != "module" ){ if( !isset($_REQUEST['zip_from_dir']) || ($_REQUEST['zip_from_dir'] == "") ){ $zip_from_dir = "."; } else{ $zip_from_dir = $_REQUEST['zip_from_dir']; } if( !isset($_REQUEST['zip_to_dir']) || ($_REQUEST['zip_to_dir'] == "") ){ $zip_to_dir = "."; } else{ $zip_to_dir = $_REQUEST['zip_to_dir']; } } $remove_tables = 'true'; if(isset($_REQUEST['remove_tables'])){ $remove_tables = $_REQUEST['remove_tables']; } $overwrite_files = true; if(isset($_REQUEST['radio_overwrite'])){ $overwrite_files = (($_REQUEST['radio_overwrite'] == 'do_not_overwrite') ? false : true); } //rrs $author = ''; $is_uninstallable = true; $name = ''; $description = ''; if($install_type == 'module'){ $is_uninstallable = $_REQUEST['is_uninstallable']; $name = $_REQUEST['name']; $description = $_REQUEST['description']; } $file_action = ""; $uh_status = ""; $rest_dir = remove_file_extension($install_file)."-restore"; $files_to_handle = array(); if(!empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan']) && $install_type != 'patch'){ require_once('ModuleInstall/ModuleScanner.php'); $ms = new ModuleScanner(); $ms->scanPackage($unzip_dir); if($ms->hasIssues()){ $ms->displayIssues(); sugar_cleanup(true); } } // // execute the PRE scripts // if($install_type == 'patch' || $install_type == 'module') { switch($mode) { case 'Install': $file = "$unzip_dir/" . constant('SUGARCRM_PRE_INSTALL_FILE'); if(is_file($file)) { print("{$mod_strings['LBL_UW_INCLUDING']}: $file