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


PHP RepairAndClear::clearJsLangFiles方法代码示例

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


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

示例1: clearAllJsAndJsLangFilesWithoutOutput

/**
 * We need to clear all the js cache files, including the js language files  in serval places in MB. So I extract them into a util function here.
 * @Depends on QuickRepairAndRebuild.php
 * @Relate bug 30642  ,23177
 */
function clearAllJsAndJsLangFilesWithoutOutput()
{
    global $current_language, $mod_strings;
    $MBmodStrings = $mod_strings;
    $mod_strings = return_module_language($current_language, 'Administration');
    include_once 'modules/Administration/QuickRepairAndRebuild.php';
    $repair = new RepairAndClear();
    $repair->module_list = array();
    $repair->show_output = false;
    $repair->clearJsLangFiles();
    $repair->clearJsFiles();
    $mod_strings = $MBmodStrings;
}
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:18,代码来源:utils.php

示例2: saveDropDown

 /**
  * Takes in the request params from a save request and processes
  * them for the save.
  *
  * @param REQUEST params  $params
  */
 function saveDropDown($params)
 {
     $count = 0;
     $dropdown = array();
     $dropdown_name = $params['dropdown_name'];
     $selected_lang = !empty($params['dropdown_lang']) ? $params['dropdown_lang'] : $_SESSION['authenticated_user_language'];
     $my_list_strings = return_app_list_strings_language($selected_lang);
     while (isset($params['slot_' . $count])) {
         $index = $params['slot_' . $count];
         $key = isset($params['key_' . $index]) ? SugarCleaner::stripTags($params['key_' . $index]) : 'BLANK';
         $value = isset($params['value_' . $index]) ? SugarCleaner::stripTags($params['value_' . $index]) : '';
         if ($key == 'BLANK') {
             $key = '';
         }
         $key = trim($key);
         $value = trim($value);
         if (empty($params['delete_' . $index])) {
             $dropdown[$key] = $value;
         }
         $count++;
     }
     if ($selected_lang == $GLOBALS['current_language']) {
         $GLOBALS['app_list_strings'][$dropdown_name] = $dropdown;
     }
     $contents = return_custom_app_list_strings_file_contents($selected_lang);
     //get rid of closing tags they are not needed and are just trouble
     $contents = str_replace("?>", '', $contents);
     if (empty($contents)) {
         $contents = "<?php";
     }
     //add new drop down to the bottom
     if (!empty($params['use_push'])) {
         //this is for handling moduleList and such where nothing should be deleted or anything but they can be renamed
         foreach ($dropdown as $key => $value) {
             //only if the value has changed or does not exist do we want to add it this way
             if (!isset($my_list_strings[$dropdown_name][$key]) || strcmp($my_list_strings[$dropdown_name][$key], $value) != 0) {
                 //clear out the old value
                 $pattern_match = '/\\s*\\$app_list_strings\\s*\\[\\s*\'' . $dropdown_name . '\'\\s*\\]\\[\\s*\'' . $key . '\'\\s*\\]\\s*=\\s*[\'\\"]{1}.*?[\'\\"]{1};\\s*/ism';
                 $contents = preg_replace($pattern_match, "\n", $contents);
                 //add the new ones
                 $contents .= "\n\$app_list_strings['{$dropdown_name}']['{$key}']=" . var_export_helper($value) . ";";
             }
         }
     } else {
         //clear out the old value
         $pattern_match = '/\\s*\\$app_list_strings\\s*\\[\\s*\'' . $dropdown_name . '\'\\s*\\]\\s*=\\s*array\\s*\\([^\\)]*\\)\\s*;\\s*/ism';
         $contents = preg_replace($pattern_match, "\n", $contents);
         //add the new ones
         $contents .= "\n\$app_list_strings['{$dropdown_name}']=" . var_export_helper($dropdown) . ";";
     }
     // Bug 40234 - If we have no contents, we don't write the file. Checking for "<?php" because above it's set to that if empty
     if ($contents != "<?php") {
         save_custom_app_list_strings_contents($contents, $selected_lang);
         sugar_cache_reset();
     }
     // Bug38011
     $repairAndClear = new RepairAndClear();
     $repairAndClear->module_list = array(translate('LBL_ALL_MODULES'));
     $repairAndClear->show_output = false;
     $repairAndClear->clearJsLangFiles();
     // ~~~~~~~~
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:68,代码来源:DropDownHelper.php

示例3: array

// disable the SugarLogger
$sugar_config['logger']['level'] = 'fatal';
$GLOBALS['sugar_config']['default_permissions'] = array('dir_mode' => 02770, 'file_mode' => 0777, 'chown' => '', 'chgrp' => '');
$GLOBALS['js_version_key'] = 'testrunner';
if (!isset($_SERVER['SERVER_SOFTWARE'])) {
    $_SERVER["SERVER_SOFTWARE"] = 'PHPUnit';
}
// helps silence the license checking when running unit tests.
$_SESSION['VALIDATION_EXPIRES_IN'] = 'valid';
$GLOBALS['startTime'] = microtime(true);
// clean out the cache directory
require_once 'modules/Administration/QuickRepairAndRebuild.php';
$repair = new RepairAndClear();
$repair->module_list = array();
$repair->show_output = false;
$repair->clearJsLangFiles();
$repair->clearJsFiles();
// mark that we got by the admin wizard already
$focus = new Administration();
$focus->retrieveSettings();
$focus->saveSetting('system', 'adminwizard', 1);
// include the other test tools
require_once 'SugarTestObjectUtilities.php';
require_once 'SugarTestProjectUtilities.php';
require_once 'SugarTestProjectTaskUtilities.php';
require_once 'SugarTestUserUtilities.php';
require_once 'SugarTestEmailAddressUtilities.php';
require_once 'SugarTestLangPackCreator.php';
require_once 'SugarTestThemeUtilities.php';
require_once 'SugarTestContactUtilities.php';
require_once 'SugarTestEmailUtilities.php';
开发者ID:sunmo,项目名称:snowlotus,代码行数:31,代码来源:SugarTestHelper.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


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