////	RUN SILENT UPGRADE
ob_start();
set_time_limit(0);
///    RELOAD NEW DEFINITIONS
global $ACLActions, $beanList, $beanFiles;
require_once 'modules/Trackers/TrackerManager.php';
$trackerManager = TrackerManager::getInstance();
$trackerManager->pause();
$trackerManager->unsetMonitors();
include 'modules/ACLActions/actiondefs.php';
include 'include/modules.php';
require_once 'modules/Administration/upgrade_custom_relationships.php';
upgrade_custom_relationships();
logThis('Upgrading user preferences start .', $path);
if (function_exists('upgradeUserPreferences')) {
    upgradeUserPreferences();
}
logThis('Upgrading user preferences finish .', $path);
// clear out the theme cache
if (is_dir($GLOBALS['sugar_config']['cache_dir'] . 'themes')) {
    $allModFiles = array();
    $allModFiles = findAllFiles($GLOBALS['sugar_config']['cache_dir'] . 'themes', $allModFiles);
    foreach ($allModFiles as $file) {
        //$file_md5_ref = str_replace(clean_path(getcwd()),'',$file);
        if (file_exists($file)) {
            unlink($file);
        }
    }
}
// re-minify the JS source files
$_REQUEST['root_directory'] = getcwd();
 /**
  * Test that file gets removed after a save from Locale page
  * @param $name_format invalid name format from data provider
  * @dataProvider badLocaleNameFormatProvider
  * @depends testCheckReturnsFalseForInvalidNameFormats
  */
 public function testFileGetsRemovedAfterLocaleSave($name_format)
 {
     global $sugar_config, $locale, $app_strings, $app_list_strings;
     require 'modules/Administration/language/en_us.lang.php';
     $this->assertFileNotExists($this->loc->invalidNameFormatUpgradeFilename);
     $sugar_config['default_locale_name_format'] = $name_format;
     upgradeUserPreferences();
     $this->assertFileExists($this->loc->invalidNameFormatUpgradeFilename);
     try {
         $_REQUEST['process'] = 'true';
         require 'modules/Administration/Locale.php';
     } catch (Exception $e) {
         $this->assertFileNotExists($this->loc->invalidNameFormatUpgradeFilename);
     }
 }