/** * Clear all related language cache files. * * @return void */ private function clearLanguageCaches() { //remove the js language files LanguageManager::removeJSLanguageFiles(); //remove lanugage cache files LanguageManager::clearLanguageCache(); }
<?php if (!defined('sugarEntry') || !sugarEntry) { die('Not A Valid Entry Point'); } /* * Your installation or use of this SugarCRM file is subject to the applicable * terms available at * http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/. * If you do not agree to all of the applicable terms or do not have the * authority to bind the entity as an authorized representative, then do not * install or use this SugarCRM file. * * Copyright (C) SugarCRM Inc. All rights reserved. */ if (is_admin($current_user)) { global $mod_strings, $sugar_config; echo $mod_strings['LBL_REBUILD_JAVASCRIPT_LANG_DESC']; //remove the js language files LanguageManager::removeJSLanguageFiles(); //remove language cache files LanguageManager::clearLanguageCache(); } else { sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); }
/** * Taken from fayebsg/sugarcrm-cli * Repair and rebuild sugarcrm * @param boolean $executeSql Launch the SQL queries * @param string $user_id User id of the admin user * @return array Messages */ public function repairAll($executeSql = false, $userId = '1') { $this->setUpQuickRepair($userId); $repair = new \RepairAndClear(); $repair->repairAndClearAll(array('clearAll'), array(translate('LBL_ALL_MODULES')), $executeSql, true, ''); //remove the js language files if (!method_exists('LanguageManager', 'removeJSLanguageFiles')) { $this->getLogger()->warning('No removeJSLanguageFiles method (sugar too old?). Check that it\'s clean.'); } else { \LanguageManager::removeJSLanguageFiles(); } return $this->getMessages(); }