module_list= $modules; $this->show_output = $show_output; $this->actions = $selected_actions; $this->actions[] = 'repairDatabase'; $this->execute=$autoexecute; //clear vardefs always.. $this->clearVardefs(); //first clear the language cache. $this->clearLanguageCache(); foreach ($this->actions as $current_action) switch($current_action) { case 'repairDatabase': if(in_array($mod_strings['LBL_ALL_MODULES'], $this->module_list)) $this->repairDatabase(); else $this->repairDatabaseSelectModules(); break; case 'rebuildExtensions': $this->rebuildExtensions(); break; case 'clearTpls': $this->clearTpls(); break; case 'clearJsFiles': $this->clearJsFiles(); break; case 'clearDashlets': $this->clearDashlets(); break; case 'clearSugarFeedCache': $this->clearSugarFeedCache(); break; case 'clearThemeCache': $this->clearThemeCache(); break; case 'clearVardefs': $this->clearVardefs(); break; case 'clearJsLangFiles': $this->clearJsLangFiles(); break; case 'rebuildAuditTables': $this->rebuildAuditTables(); break; case 'clearSearchCache': $this->clearSearchCache(); break; case 'clearAll': $this->clearTpls(); $this->clearJsFiles(); $this->clearVardefs(); $this->clearJsLangFiles(); $this->clearLanguageCache(); $this->clearDashlets(); $this->clearSugarFeedCache(); $this->clearSmarty(); $this->clearThemeCache(); $this->clearXMLfiles(); $this->clearSearchCache(); $this->clearExternalAPICache(); $this->rebuildExtensions(); $this->rebuildAuditTables(); $this->repairDatabase(); break; } } /////////////OLD public function repairDatabase() { global $dictionary, $mod_strings; if(false == $this->show_output) $_REQUEST['repair_silent']='1'; $_REQUEST['execute']=$this->execute; $GLOBALS['reload_vardefs'] = true; $hideModuleMenu = true; include_once('modules/Administration/repairDatabase.php'); } public function repairDatabaseSelectModules() { global $current_user, $mod_strings, $dictionary; set_time_limit(3600); include('include/modules.php'); //bug 15661 $db = DBManagerFactory::getInstance(); if (is_admin($current_user) || is_admin_for_any_module($current_user)) { $export = false; if($this->show_output) echo getClassicModuleTitle($mod_strings['LBL_REPAIR_DATABASE'], array($mod_strings['LBL_REPAIR_DATABASE']), false); if($this->show_output) { echo "
" .$mod_strings['LBL_REPAIR_DB_FOR'].' '. $bean_name . "
"); $sql .= $db->repairTable($focus, $this->execute); } } } $GLOBALS['sugar_config']['developerMode'] = $dm; if ($this->show_output) echo ""; if (isset ($sql) && !empty ($sql)) { $qry_str = ""; foreach (explode("\n", $sql) as $line) { if (!empty ($line) && substr($line, -2) != "*/") { $line .= ";"; } $qry_str .= $line . "\n"; } if ($this->show_output){ echo "{$mod_strings['LBL_REPAIR_DATABASE_TEXT']}
"; echo "