Ejemplo n.º 1
0
 /**
  * Rebuilds the extension files found in custom/Extension
  * @param boolean $silent
  */
 function rebuild_all($silent = false)
 {
     if (defined('TEMPLATE_URL')) {
         SugarTemplateUtilities::disableCache();
     }
     $this->silent = $silent;
     global $sugar_config;
     //Check for new module extensions
     $this->rebuild_modules();
     $this->rebuild_languages($sugar_config['languages']);
     $this->rebuild_extensions();
     $this->rebuild_dashletcontainers();
     $this->rebuild_relationships();
     $this->rebuild_tabledictionary();
     $this->reset_opcodes();
     sugar_cache_reset();
 }
Ejemplo n.º 2
0
 function action_DeployPackage()
 {
     if (defined('TEMPLATE_URL')) {
         sugar_cache_reset();
         SugarTemplateUtilities::disableCache();
     }
     $mb = new ModuleBuilder();
     $load = $_REQUEST['package'];
     $message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
     if (!empty($load)) {
         $zip = $mb->getPackage($load);
         require_once 'ModuleInstall/PackageManager/PackageManager.php';
         $pm = new PackageManager();
         $info = $mb->packages[$load]->build(false);
         mkdir_recursive($GLOBALS['sugar_config']['cache_dir'] . '/upload/upgrades/module/');
         rename($info['zip'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip');
         copy($info['manifest'], $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '-manifest.php');
         $_REQUEST['install_file'] = $GLOBALS['sugar_config']['cache_dir'] . '/' . 'upload/upgrades/module/' . $info['name'] . '.zip';
         $GLOBALS['mi_remove_tables'] = false;
         $pm->performUninstall($load);
         //#23177 , js cache clear
         clearAllJsAndJsLangFilesWithoutOutput();
         //#30747, clear the cache in memoy
         $cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
         sugar_cache_clear($cache_key);
         sugar_cache_reset();
         //clear end
         $pm->performInstall($_REQUEST['install_file']);
     }
     echo 'complete';
 }
Ejemplo n.º 3
0
 function rebuild_all($silent = false)
 {
     if (defined('TEMPLATE_URL')) {
         SugarTemplateUtilities::disableCache();
     }
     $this->silent = $silent;
     global $sugar_config;
     $this->rebuild_languages($sugar_config['languages']);
     $this->rebuild_vardefs();
     $this->rebuild_layoutdefs();
     $this->rebuild_menus();
     $this->rebuild_userpage();
     $this->rebuild_administration();
     $this->rebuild_relationships();
     //$this->repair_indices();
     sugar_cache_reset();
 }
Ejemplo n.º 4
0
 function action_DeployPackage()
 {
     global $current_user;
     if (defined('TEMPLATE_URL')) {
         sugar_cache_reset();
         SugarTemplateUtilities::disableCache();
     }
     //increment etag for menu so the new module shows up when the AJAX UI reloads
     $current_user->incrementETag("mainMenuETag");
     $mb = new ModuleBuilder();
     $load = $_REQUEST['package'];
     $message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
     if (!empty($load)) {
         $zip = $mb->getPackage($load);
         require_once 'ModuleInstall/PackageManager/PackageManager.php';
         $pm = new PackageManager();
         $info = $mb->packages[$load]->build(false);
         $uploadDir = $pm->upload_dir . '/upgrades/module/';
         mkdir_recursive($uploadDir);
         rename($info['zip'], $uploadDir . $info['name'] . '.zip');
         copy($info['manifest'], $uploadDir . $info['name'] . '-manifest.php');
         $_REQUEST['install_file'] = $uploadDir . $info['name'] . '.zip';
         $GLOBALS['mi_remove_tables'] = false;
         $pm->performUninstall($load);
         //#23177 , js cache clear
         clearAllJsAndJsLangFilesWithoutOutput();
         //#30747, clear the cache in memory
         $cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
         sugar_cache_clear($cache_key);
         sugar_cache_reset();
         //clear end
         $pm->performInstall($_REQUEST['install_file'], true);
         //clear the unified_search_module.php file
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
         //bug 44269 - start
         //clear workflow admin modules cache
         if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
             unset($_SESSION['get_workflow_admin_modules_for_user']);
         }
         //clear "is_admin_for_module" cache
         $sessionVar = 'MLA_' . $current_user->user_name;
         foreach ($mb->packages as $package) {
             foreach ($package->modules as $module) {
                 $_SESSION[$sessionVar][$package->name . '_' . $module->name] = true;
             }
         }
         //recreate acl cache
         $actions = ACLAction::getUserActions($current_user->id, true);
         //bug 44269 - end
     }
     echo 'complete';
 }
Ejemplo n.º 5
0
 /**
  * Rebuilds the extension files found in custom/Extension
  *
  * @param boolean $silent
  * @param array   $modules optional list of modules to update. If $modules is empty, all modules are rebuilt
  */
 function rebuild_all($silent = false, $modules = array())
 {
     if (defined('TEMPLATE_URL')) {
         SugarTemplateUtilities::disableCache();
     }
     $this->silent = $silent;
     global $sugar_config;
     $this->rebuild_languages($sugar_config['languages'], $modules);
     $this->rebuild_extensions($modules);
     $this->rebuild_dashletcontainers($modules);
     // This will be a time consuming process, particularly if $modules is empty
     $this->rebuild_relationships(array_flip($modules));
     $this->rebuild_tabledictionary();
     $this->reset_opcodes();
     sugar_cache_reset();
 }