当前位置: 首页>>代码示例>>PHP>>正文


PHP RepairAndClear::clearVardefs方法代码示例

本文整理汇总了PHP中RepairAndClear::clearVardefs方法的典型用法代码示例。如果您正苦于以下问题:PHP RepairAndClear::clearVardefs方法的具体用法?PHP RepairAndClear::clearVardefs怎么用?PHP RepairAndClear::clearVardefs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RepairAndClear的用法示例。


在下文中一共展示了RepairAndClear::clearVardefs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: RepairAndClear

global $path;
global $sugar_config;
if ($unzip_dir == null) {
    $unzip_dir = $_SESSION['unzip_dir'];
}
//First repair the databse to ensure it is up to date with the new vardefs/tabledefs
logThis('About to repair the database.', $path);
//Use Repair and rebuild to update the database.
global $dictionary, $beanFiles;
require_once 'modules/Trackers/TrackerManager.php';
$trackerManager = TrackerManager::getInstance();
$trackerManager->pause();
$trackerManager->unsetMonitors();
require_once "modules/Administration/QuickRepairAndRebuild.php";
$rac = new RepairAndClear();
$rac->clearVardefs();
$rac->rebuildExtensions();
//bug: 44431 - defensive check to ensure the method exists since upgrades to 6.2.0 may not have this method define yet.
if (method_exists($rac, 'clearExternalAPICache')) {
    $rac->clearExternalAPICache();
}
$repairedTables = array();
foreach ($beanFiles as $bean => $file) {
    if (file_exists($file)) {
        require_once $file;
        unset($GLOBALS['dictionary'][$bean]);
        $focus = new $bean();
        if ($focus instanceof SugarBean) {
            if (!isset($repairedTables[$focus->table_name])) {
                $sql = $GLOBALS['db']->repairTable($focus, true);
                if (trim($sql) != '') {
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:31,代码来源:end.php

示例2: strtolower

                                if (is_array($entry) && isset($entry['name'])) {
                                    $parser->_viewdefs['panels'][$panel_id][$row_id][$entry_id]['name'] = strtolower($entry['name']);
                                }
                            }
                        }
                    }
                } else {
                    //For basic_search and advanced_search views, just process the fields
                    foreach ($parser->_viewdefs as $entry_id => $entry) {
                        if (is_array($entry) && isset($entry['name'])) {
                            $parser->_viewdefs[$entry_id]['name'] = strtolower($entry['name']);
                        }
                    }
                }
                //Save the changes
                $parser->handleSave(false);
            }
            //foreach
            //Now clear the cache of the .tpl files
            TemplateHandler::clearCache($module);
        }
        //foreach
        echo '<br>' . $mod_strings['LBL_CLEAR_VARDEFS_DATA_CACHE_TITLE'];
        require_once 'modules/Administration/QuickRepairAndRebuild.php';
        $repair = new RepairAndClear();
        $repair->show_output = false;
        $repair->module_list = array($class_names);
        $repair->clearVardefs();
    }
    echo '<br>' . $mod_strings['LBL_DIAGNOSTIC_DONE'];
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:31,代码来源:RepairFieldCasing.php

示例3: trim

 function action_SaveField()
 {
     require_once 'modules/DynamicFields/FieldCases.php';
     $field = get_widget($_REQUEST['type']);
     $_REQUEST['name'] = trim($_POST['name']);
     $field->populateFromPost();
     if (!isset($_REQUEST['view_package'])) {
         require_once 'modules/DynamicFields/DynamicField.php';
         if (!empty($_REQUEST['view_module'])) {
             $module = $_REQUEST['view_module'];
             $df = new DynamicField($module);
             $class_name = $GLOBALS['beanList'][$module];
             require_once $GLOBALS['beanFiles'][$class_name];
             $mod = new $class_name();
             $df->setup($mod);
             $field->save($df);
             $this->action_SaveLabel();
             include_once 'modules/Administration/QuickRepairAndRebuild.php';
             global $mod_strings;
             $mod_strings['LBL_ALL_MODULES'] = 'all_modules';
             $repair = new RepairAndClear();
             $repair->show_output = false;
             $repair->module_list = array($class_name);
             $repair->clearVardefs();
             //#28707 ,clear all the js files in cache
             $repair->module_list = array();
             $repair->clearJsFiles();
         }
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $field->save($module);
         $module->mbvardefs->save();
         // get the module again to refresh the labels we might have saved with the $field->save (e.g., for address fields)
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         if (isset($_REQUEST['label']) && isset($_REQUEST['labelValue'])) {
             $module->setLabel($GLOBALS['current_language'], $_REQUEST['label'], $_REQUEST['labelValue']);
         }
         $module->save();
     }
     $this->view = 'modulefields';
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:42,代码来源:controller.php

示例4: build

 function build()
 {
     $modulesToBuild = array();
     if (!isset($this->relationships[$this->newRelationshipName])) {
         $GLOBALS['log']->fatal("Could not find a relationship by the name of {$this->newRelationshipName}, you will have to quick repair and rebuild to get the new relationship added.");
     } else {
         $newRel = $this->relationships[$this->newRelationshipName];
         $newRelDef = $newRel->getDefinition();
         $modulesToBuild[$newRelDef['rhs_module']] = true;
         $modulesToBuild[$newRelDef['lhs_module']] = true;
     }
     $basepath = "custom/Extension/modules";
     $this->activitiesToAdd = false;
     // and mark all as built so that the next time we come through we'll know and won't build again
     foreach ($this->relationships as $name => $relationship) {
         if ($relationship->readonly()) {
             continue;
         }
         $definition = $relationship->getDefinition();
         // activities will always appear on the rhs only - lhs will be always be this module in MB
         if (strtolower($definition['rhs_module']) == 'activities') {
             $this->activitiesToAdd = true;
             $relationshipName = $definition['relationship_name'];
             foreach (self::$activities as $activitiesSubModuleLower => $activitiesSubModuleName) {
                 $definition['rhs_module'] = $activitiesSubModuleName;
                 $definition['for_activities'] = true;
                 $definition['relationship_name'] = $relationshipName . '_' . $activitiesSubModuleLower;
                 $this->relationships[$definition['relationship_name']] = RelationshipFactory::newRelationship($definition);
             }
             unset($this->relationships[$name]);
         }
     }
     $GLOBALS['log']->info(get_class($this) . "->build(): installing relationships");
     $MBModStrings = $GLOBALS['mod_strings'];
     $adminModStrings = return_module_language('', 'Administration');
     // required by ModuleInstaller
     foreach ($this->relationships as $name => $relationship) {
         if ($relationship->readonly()) {
             continue;
         }
         $relationship->setFromStudio();
         $GLOBALS['mod_strings'] = $MBModStrings;
         $installDefs = parent::build($basepath, "<basepath>", array($name => $relationship));
         // and mark as built so that the next time we come through we'll know and won't build again
         $relationship->setReadonly();
         $this->relationships[$name] = $relationship;
         // now install the relationship - ModuleInstaller normally only does this as part of a package load where it installs the relationships defined in the manifest. However, we don't have a manifest or a package, so...
         // If we were to chose to just use the Extension mechanism, without using the ModuleInstaller install_...() methods, we must :
         // 1)   place the information for each side of the relationship in the appropriate Ext directory for the module, which means specific $this->save...() methods for DeployedRelationships, and
         // 2)   we must also manually add the relationship into the custom/application/Ext/TableDictionary/tabledictionary.ext.php file as install_relationship doesn't handle that (install_relationships which requires the manifest however does)
         //      Relationships must be in tabledictionary.ext.php for the Admin command Rebuild Relationships to reliably work:
         //      Rebuild Relationships looks for relationships in the modules vardefs.php, in custom/modules/<modulename>/Ext/vardefs/vardefs.ext.php, and in modules/TableDictionary.php and custom/application/Ext/TableDictionary/tabledictionary.ext.php
         //      if the relationship is not defined in one of those four places it could be deleted during a rebuilt, or during a module installation (when RebuildRelationships.php deletes all entries in the Relationships table)
         // So instead of doing this, we use common save...() methods between DeployedRelationships and UndeployedRelationships that will produce installDefs,
         // and rather than building a full manifest file to carry them, we manually add these installDefs to the ModuleInstaller, and then
         // individually call the appropriate ModuleInstaller->install_...() methods to take our relationship out of our staging area and expand it out to the individual module Ext areas
         $GLOBALS['mod_strings'] = $adminModStrings;
         require_once 'ModuleInstall/ModuleInstaller.php';
         $mi = new ModuleInstaller();
         $mi->id_name = 'custom' . $name;
         // provide the moduleinstaller with a unique name for this relationship - normally this value is set to the package key...
         $mi->installdefs = $installDefs;
         $mi->base_dir = $basepath;
         $mi->silent = true;
         VardefManager::clearVardef();
         $mi->install_relationships();
         $mi->install_languages();
         $mi->install_vardefs();
         $mi->install_layoutdefs();
         $mi->install_extensions();
         $mi->install_client_files();
     }
     $GLOBALS['mod_strings'] = $MBModStrings;
     // finally, restore the ModuleBuilder mod_strings
     // Anything that runs in-process needs to reload their vardefs
     $GLOBALS['reload_vardefs'] = true;
     // save out the updated definitions so that we keep track of the change in built status
     // sending false so we don't rebuild relationshsips for a third time.
     $this->save(false);
     $mi = new ModuleInstaller();
     $mi->silent = true;
     $mi->rebuild_relationships($modulesToBuild);
     // now clear all caches so that our changes are visible
     require_once 'modules/Administration/QuickRepairAndRebuild.php';
     $rac = new RepairAndClear();
     $rac->module_list = $modulesToBuild;
     $rac->clearJsFiles();
     $rac->clearVardefs();
     $rac->clearJsLangFiles();
     $rac->clearLanguageCache();
     $rac->rebuildExtensions(array_keys($modulesToBuild));
     $rac->clearVardefs();
     foreach ($rac->module_list as $moduleName => $ignore) {
         // Now rebuild the vardefs in memory
         $bean = BeanFactory::newBean($moduleName);
         VardefManager::loadVardef($bean->module_dir, $bean->object_name, true, array('bean' => $bean));
     }
     foreach (array_keys($modulesToBuild) as $module) {
         unset($GLOBALS['dictionary'][BeanFactory::getObjectName($module)]);
     }
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:DeployedRelationships.php

示例5: runRebuildExtensions

 public function runRebuildExtensions(array $modules = array('Forecasts'))
 {
     SugarAutoLoader::load('modules/Administration/QuickRepairAndRebuild.php');
     $rac = new RepairAndClear();
     $rac->show_output = false;
     $rac->module_list = $modules;
     $rac->clearVardefs();
     $rac->rebuildExtensions($modules);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:9,代码来源:ForecastReset.php

示例6: run

 public function run()
 {
     global $dictionary, $beanFiles;
     include "include/modules.php";
     require_once "modules/Administration/QuickRepairAndRebuild.php";
     $rac = new RepairAndClear('', '', false, false);
     $rac->clearVardefs();
     $rac->rebuildExtensions();
     $rac->clearExternalAPICache();
     // this is dirty, but otherwise SugarBean caches old defs :(
     $GLOBALS['reload_vardefs'] = true;
     $repairedTables = array();
     foreach ($beanFiles as $bean => $file) {
         if (file_exists($file)) {
             unset($GLOBALS['dictionary'][$bean]);
             require_once $file;
             $focus = new $bean();
             if (empty($focus->table_name) || isset($repairedTables[$focus->table_name])) {
                 continue;
             }
             if ($focus instanceof SugarBean) {
                 if (!isset($repairedTables[$focus->table_name])) {
                     $sql = $this->db->repairTable($focus, true);
                     if (trim($sql) != '') {
                         $this->log('Running sql: ' . $sql);
                     }
                     $repairedTables[$focus->table_name] = true;
                 }
                 //Check to see if we need to create the audit table
                 if ($focus->is_AuditEnabled() && !$focus->db->tableExists($focus->get_audit_table_name())) {
                     $this->log('Creating audit table:' . $focus->get_audit_table_name());
                     $focus->create_audit_table();
                 }
             }
         }
     }
     unset($dictionary);
     include "modules/TableDictionary.php";
     foreach ($dictionary as $meta) {
         $tablename = $meta['table'];
         if (isset($repairedTables[$tablename])) {
             continue;
         }
         $fielddefs = $meta['fields'];
         $indices = $meta['indices'];
         $sql = $this->db->repairTableParams($tablename, $fielddefs, $indices, true);
         if (!empty($sql)) {
             $this->log('Running sql: ' . $sql);
             $repairedTables[$tablename] = true;
         }
     }
     $this->log('Database repaired');
     $this->log('Start rebuilding relationships');
     $_REQUEST['silent'] = true;
     include 'modules/Administration/RebuildRelationship.php';
     $_REQUEST['upgradeWizard'] = true;
     include 'modules/ACL/install_actions.php';
     $this->log('Done rebuilding relationships');
     unset($GLOBALS['reload_vardefs']);
     // enable metadata caching once the database schema has been rebuilt
     MetaDataManager::enableCache();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:62,代码来源:2_Rebuild.php


注:本文中的RepairAndClear::clearVardefs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。