Skip to content

Instantly share code, notes, and snippets.

@vratiu
Created March 26, 2015 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vratiu/ec71e3506935a8ff902f to your computer and use it in GitHub Desktop.
Save vratiu/ec71e3506935a8ff902f to your computer and use it in GitHub Desktop.
Quick repair and rebuild script
<?php
if (php_sapi_name() !== "cli") {
die(1);
}
define('sugarEntry', true);
$runSQL = false;
if (!empty($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'true') {
$runSQL = true;
}
// Run the repair and rebuild to install the custom fields that were populated into fields_meta_data table
require_once('include/entryPoint.php');
$GLOBALS['current_user'] = BeanFactory::getBean('Users', '1');
require('modules/Administration/language/en_us.lang.php');
SugarAutoLoader::requireWithCustom('modules/Administration/QuickRepairAndRebuild.php');
$repairClass = SugarAutoLoader::customClass('RepairAndClear');
$randc = new $repairClass();
$randc->repairAndClearAll(array('clearAll'), array($mod_strings['LBL_ALL_MODULES']), $runSQL, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment